I plot a function using the following code:
t = np.arange(0., 5., 0.2)
plt.plot(t, (t**2)+10*np.sin(t))
plt.axis('off')
I am wondering how to save the plot as a 0/1 array, where a pixel value is 1 if the plot passes it, otherwise it's 0.
A follow up question is, if I draw the plot with some line width, I want the pixel value to be 1 only if it is on the "central" line of the plot, otherwise it's 0. How should I do it? Thank you!
