Trimming Trailing Xticks Zeros With Matplotlib
I'm very new to using matplotlib, and I'm having difficulty with the xticks. I basically have an x axis from 0 to 0.025. My problem arises since the precision of the most precise v
Solution 1:
What you need are these two lines:
from matplotlib.tickerimportFormatStrFormatter
plt.gca().xaxis.set_major_formatter(FormatStrFormatter('%g'))
The FormatStrFormatter can accept other sprintf-like formatting options.
Post a Comment for "Trimming Trailing Xticks Zeros With Matplotlib"