I am using matplotlib to plot data. Here\'s a code that does something similar:
import matplotlib.pyplot as plt
f, ax = plt.subplots(1)
xdata = [1, 4, 8]
yda
The range must be set after the plot.
import matplotlib.pyplot as plt
f, ax = plt.subplots(1)
xdata = [1, 4, 8]
ydata = [10, 20, 30]
ax.plot(xdata, ydata)
ax.set_ylim(ymin=0)
plt.show(f)
If ymin is changed before plotting, this will result in a range of [0, 1].
Edit: the ymin argument has been replaced by bottom:
ax.set_ylim(bottom=0)