How to prevent numbers being changed to exponential form in Python matplotlib figure

The formatting of tick labels is controlled by a Formatter object, which assuming you haven’t done anything fancy will be a ScalerFormatterby default. This formatter will use a constant shift if the fractional change of the values visible is very small. To avoid this, simply turn it off: plt.plot(arange(0,100,10) + 1000, arange(0,100,10)) ax = plt.gca() … Read more

Matplotlib different size subplots

Another way is to use the subplots function and pass the width ratio with gridspec_kw matplotlib Tutorial: Customizing Figure Layouts Using GridSpec and Other Functions matplotlib.gridspec.GridSpec has available gridspect_kw options import numpy as np import matplotlib.pyplot as plt # generate some data x = np.arange(0, 10, 0.2) y = np.sin(x) # plot it f, (a0, … Read more