Setting the same axis limits for all subplots

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

Barchart with vertical ytick labels

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

How can I plot with 2 different y-axes?

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