I am trying to plot a graph, but the x axis does not automatically format how I want. When I change this formatting, the graph no longer appears. Here is my code.
#start=float(t_array_hr[0])
#stop=float(t_array_hr[-1])
#xticks=(np.linspace(start,stop,8))
plt.plot(t_array_hr,Mdot_hr)
plt.xlabel('Time (s)')
plt.ylabel('Mdot in Solar Masses/yr')
plt.title('Rate of Mass Loss vs Time')
plt.gca().invert_yaxis()
#plt.xticks(xticks,xticks)
When run as above, I get the following graph.
When the commented lines are included, I get this graph (the formatting is not complete but I have reserved that for a separate question.)
How can I format the x axis without affecting the graph itself?