ticker

Custom ticks label in scientific notation while using log scale

Custom ticks label in scientific notation while using log scale Question: I’m having trouble with matplotlib (version 3.1.3) : I would like to add custom ticks and tick labels on a log scale axis while preserving scientific notation. To say it otherwise: I want to add custom ticks on a log scale axis and label …

Total answers: 2

Matplotlib pyplot axes formatter

Matplotlib pyplot axes formatter Question: I have an image: Here in the y-axis I would like to get 5×10^-5 4×10^-5 and so on instead of 0.00005 0.00004. What I have tried so far is: fig = plt.figure() ax = fig.add_subplot(111) y_formatter = matplotlib.ticker.ScalarFormatter(useOffset=True) ax.yaxis.set_major_formatter(y_formatter) ax.plot(m_plot,densities1,’-ro’,label=’0.0<z<0.5′) ax.plot(m_plot,densities2, ‘-bo’,label=’0.5<z<1.0′) ax.legend(loc=’best’,scatterpoints=1) plt.legend() plt.show() This does not seem to …

Total answers: 2