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

    11 Subplots with pandas This answer is for subplots with pandas, which uses matplotlib as the default plotting backend. Here are four options to create subplots starting with a pandas.DataFrame …

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

    subplot(2,2,[1,2]) % the plot will span subplots 1 and 2 Is it also possible in pyplot to have a single axes occupy more than one subplot? The docstring of pyplot.subplot doesn't talk about it. Anyone got an …

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

    import matplotlib.pyplot as plt fig2 = plt.figure() ax3 = fig2.add_subplot(2,1,1) ax4 = fig2.add_subplot(2,1,2) ax4.loglog(x1, y1) ax3.loglog(x2, y2) ax3.set_ylabel('hello') I want to create …

  4. Is there a way to add a second y axis to a subplot?

    (I think) I know about the twiny/x function in matplotlib, but I am really struggling to figure out how to use this function in a subplot context. I have a line plot like this showing rainfall data:

  5. How to plot multiple dataframes in subplots - Stack Overflow

    Jul 20, 2022 · Keep in mind that the subplots and layout kwargs will generate multiple plots ONLY for a single dataframe. This is related to, but not a solution for OP's question of plotting multiple …

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

    However, tight_layout can be set when creating the figure, because matplotlib.pyplot.subplots accepts additional parameters with **fig_kw. All additional keyword arguments are passed to the pyplot.figure …

  7. Dynamically add/create subplots in matplotlib - Stack Overflow

    Sep 7, 2012 · 55 I want to create a plot consisting of several subplots with shared x/y axes. It should look something like this from the documentation (though my subplots will be scatterblots): (code …

  8. python - Matplotlib different size subplots - Stack Overflow

    Apr 30, 2012 · As of matplotlib 3.6.0, width_ratios and height_ratios can now be passed directly as keyword arguments to plt.subplots and subplot_mosaic, as per What's new in Matplotlib 3.6.0 (Sep …

  9. Python - matplotlib - differences between subplot() and subplots()

    Sep 7, 2018 · 1. matplotlib.pyplot.subplots() From the documentation page on matplotlib.pyplot.subplots(): This utility wrapper makes it convenient to create common layouts of …

  10. python - How to remove gaps between subplots - Stack Overflow

    The code below produces gaps between the subplots. How do I remove the gaps between the subplots and make the image a tight grid? import matplotlib.pyplot as plt for i in range(16): i = i + 1...