Reputation: 960
I am making some prototype which displays diagrams like
import matplotlib.pyplot as plt
...
plt.plot(xs, ys)
...
plt.show()
Getting window like
and now want to correct programmatically extent of the diagram to be open. To get something like
right after start. How to do this?
Upvotes: 1
Views: 977
Reputation: 900
You need to set the upper and lower bounds for the x-axis and y-axis:
plt.xlim([0,45])
plt.ylim([0.00025,0.00200])
Use these after plt.plot()
and before plt.show()
Upvotes: 2