Reputation: 11
I have a code that draws the voltage of a battery in discharge mode vs time in real-time with drawnow but after a while, the time label ticks get too close to each other that no one can read it how to set an automatic scale factor like plt.autoscale for x-axis so the time get separated and update every time thnks
def CreatePlot():
plt.subplot(2,2,1)
plt.grid(True)
plt.ylabel('Voltage')
plt.plot(Time,Voltage_0,'g-', label='V1')
plt.autoscale()
Time
and
Voltage_0
are lists that are appending through time
Sample image of X axis overlaps:
Upvotes: 1
Views: 122