Skip to content Skip to sidebar Skip to footer

Inconsistent Decimals In Tick Labels When Using A Log Axis

I'm trying to create a plot with a log y-axis and integer tick labels, but at best I'm getting inconsistent decimals. The simplest approach gives scientific notation: import matplo

Solution 1:

As an example, you could use a StrMethodFormatter with python's g format:

fmt = mpl.ticker.StrMethodFormatter("{x:g}")
ax.yaxis.set_major_formatter(fmt)
ax.yaxis.set_minor_formatter(fmt)

enter image description here

Post a Comment for "Inconsistent Decimals In Tick Labels When Using A Log Axis"