Sep-18-2022, 10:48 AM
(This post was last modified: Sep-18-2022, 11:37 AM by Yoriz.
Edit Reason: Added code tags
)
My code displays temperatures imported from an excel sheet.
The graph works as I want but I cannot see how to show an xtick every 24 hours rather than the hourly ticks it is currently showing
This beginner to matplotlib seeks advice
Thanks in advance
The graph works as I want but I cannot see how to show an xtick every 24 hours rather than the hourly ticks it is currently showing
This beginner to matplotlib seeks advice
Thanks in advance
plt.figure(figsize=(24, 16))
plt.xticks(fontsize=15,fontweight='bold')
plt.yticks(fontsize=15,fontweight='bold')
plt.plot(df[str('Temperature')],ls='-',linewidth=10)
plt.plot(df[str('Zero')], ls='-')
plt.xlabel('Hours since start',fontsize=15,fontweight='bold')
plt.ylabel('temp',fontsize=15,fontweight='bold')
plt.title('Temperature Centigrade',fontsize=15,fontweight='bold')
plt.grid(True)
plt.gca().xaxis.set_major_locator(mdates.DayLocator())
plt.gcf().autofmt_xdate()
plt.xticks(ticks=None, labels=None, rotation=90)
plt.show()
