How fill all the area under the curve?
Question:
I have the next code
plt.plot(t,w_rot)
plt.fill_between(t, w_rot, 0, w_rot>0, color='b')
plt.fill_between(t, w_rot, 0, w_rot<0, color='r')
and the plot result varies of the value of the resolution, if I have a higher resolution of data the area it’s filled completely:
If I have a lower resolution of data the filled area looks like this:
The dt
variable it’s the interval between time samples in seconds, length
it’s the total length of the pulse in seconds.
How can the area be completely full in both scenarios?
Answers:
try (see example)
interpolate=True
I have the next code
plt.plot(t,w_rot)
plt.fill_between(t, w_rot, 0, w_rot>0, color='b')
plt.fill_between(t, w_rot, 0, w_rot<0, color='r')
and the plot result varies of the value of the resolution, if I have a higher resolution of data the area it’s filled completely:
If I have a lower resolution of data the filled area looks like this:
The dt
variable it’s the interval between time samples in seconds, length
it’s the total length of the pulse in seconds.
How can the area be completely full in both scenarios?
try (see example)
interpolate=True