About 272,000 results
Open links in new tab
  1. python - How to plot in multiple subplots - Stack Overflow

    13 Read the documentation: matplotlib.pyplot.subplots pyplot.subplots() returns a tuple fig, ax which is unpacked in two variables using the notation fig, axes = plt.subplots(nrows=2, …

  2. How to make an axes occupy multiple subplots with pyplot

    9 There are three main options in matplotlib to make separate plots within a figure: subplot: access the axes array and add subplots gridspec: control the geometric properties of the …

  3. How to set common axes labels for subplots - Stack Overflow

    I want to create axes labels and titles that span on both subplots. For example, since both plots have identical axes, I only need one set of xlabel and ylabel.

  4. How to set a single, main title above all the subplots

    Aug 15, 2011 · I am using pyplot. I have 4 subplots. How to set a single, main title above all the subplots? title() sets it above the last subplot.

  5. Improve subplot size/spacing with many subplots - Stack Overflow

    The .plot method returns a numpy array of matplotlib.axes.Axes, which should be flattened to easily work with. Use .get_figure() to extract the DataFrame.plot figure object from one of the …

  6. How to have one colorbar for all subplots - Stack Overflow

    Just place the colorbar in its own axis and use subplots_adjust to make room for it. As a quick example: import numpy as np import matplotlib.pyplot as plt fig, axes = plt.subplots(nrows=2, …

  7. How do I change the figure size with subplots? - Stack Overflow

    10 You can use plt.figure(figsize = (16,8)) to change figure size of a single plot and with up to two subplots. (arguments inside figsize lets to modify the figure size) To change figure size of more …

  8. How do I make a single legend for many subplots? - Stack Overflow

    I am plotting the same type of information, but for different countries, with multiple subplots with Matplotlib. That is, I have nine plots on a 3x3 grid, all with the same for lines (of course, …

  9. python - How to set xticks in subplots - Stack Overflow

    Since matplotlib 3.5.0, you can set ticks and its labels on one function call using Axes.set_xticks (similar to plt.xticks). Since axes[i,j] is an Axes object, calling set_xticks on it and pass tick …

  10. matplotlib - return values of subplot - Stack Overflow

    Apr 15, 2015 · In the documentation it says that matplotlib.pyplot.subplots return an instance of Figure and an array of (or a single) Axes (array or not depends on the number of subplots). …