yaxis range display using absolute values rather than offset values
set useOffset to False: ax = plt.gca() ax.ticklabel_format(useOffset=False)
set useOffset to False: ax = plt.gca() ax.ticklabel_format(useOffset=False)
While Joe Kington certainly proposes the most sensible answer when he recommends that only the necessary data be plotted, there are situations where it would be best to plot all of the data and just zoom to a certain section. Additionally, it would be nice to have an “autoscale_y” function that only requires the axes … Read more
Set the xlim and ylim properties on the Artist object by matplotlib.pyplot.setp() https://matplotlib.org/3.1.0/api/_as_gen/matplotlib.pyplot.setp.html # Importing matplotlib.pyplot package. import matplotlib.pyplot as plt # Assigning ‘fig’, ‘ax’ variables. fig, ax = plt.subplots(2, 2) # Defining custom ‘xlim’ and ‘ylim’ values. custom_xlim = (0, 100) custom_ylim = (-100, 100) # Setting the values for all axes. plt.setp(ax, xlim=custom_xlim, … Read more
Do you mean something like this: >>> from matplotlib import * >>> plot(xrange(10)) >>> yticks(xrange(10), rotation=’vertical’) ? In general, to show any text in matplotlib with a vertical orientation, you can add the keyword rotation=’vertical’. For further options, you can look at help(matplotlib.pyplot.text) The yticks function plots the ticks on the y axis; I am … Read more
Get current axis via plt.gca(), and then set its limits: ax = plt.gca() ax.set_xlim([xmin, xmax]) ax.set_ylim([ymin, ymax])
update: Copied material that was on the R wiki at http://rwiki.sciviews.org/doku.php?id=tips:graphics-base:2yaxes, link now broken: also available from the wayback machine Two different y axes on the same plot (some material originally by Daniel Rajdl 2006/03/31 15:26) Please note that there are very few situations where it is appropriate to use two different scales on the … Read more