subplot Questions
2
Solved
for each subplot I have 3 seperate line:2017 ,2018 and 2019 with 3 times "go.Scatter", each subplot represents one country (25 countries) with always these 3 years. I can use the subplot ...
3
Solved
I have a figure consisting of 3 subplots. I would like to locate the last subplot in the middle of the second row. Currently it is located in the left bottom of the figure. How do I do this? I cann...
3
Solved
If I plot a single imshow plot I can use
fig, ax = plt.subplots()
ax.imshow(data)
plt.xticks( [4, 14, 24], [5, 15, 25] )
to replace my xtick labels.
Now, I am plotting 12 imshow plots using
f, axa...
Bushey asked 28/10, 2013 at 2:56
1
I'm trying to remove the vertical space between two specific axes; however plt.figure(layout='constrained') prevents matplotlib.pyplot.subplots_adjust(hspace=0).
With layout='constrained'
import ma...
Manis asked 23/3, 2023 at 21:5
7
Solved
I need to add two subplots to a figure. One subplot needs to be about three times as wide as the second (same height). I accomplished this using GridSpec and the colspan argument but I would like t...
Oratory asked 30/4, 2012 at 18:9
5
Solved
If you want to insert a small plot inside a bigger one you can use Axes, like here.
The problem is that I don't know how to do the same inside a subplot.
I have several subplots and I would like to...
Clift asked 3/7, 2013 at 21:41
2
Solved
How I do multiple plot from a multi-indexed pandas DataFrame based on one of the levels of the multiindex?
I have results from a model with different technologies usage in different scenarios, the...
Laciniate asked 23/1, 2017 at 16:42
1
I have a certain amount of figures I want to generate and organize in subplots, and I would like to automatically find the amount of columns and rows to specify in my subplots. So far the best way ...
Nanna asked 12/4, 2021 at 0:37
2
Solved
In matlab, it's straightforward to get and set the position of an existing axes on the figure:
pos = get(gca(), 'position')
set(gca(), 'position', pos)
How do I do this in matplotlib?
I need this ...
Biles asked 17/4, 2014 at 15:59
6
Solved
I am making a group of subplot (say, 3 x 2) in matplotlib, but I have fewer than 6 datasets. How can I make the remaining subplot blank?
The arrangement looks like this:
+----+----+
| 0,0| 0,1|
+...
Berkey asked 5/4, 2012 at 20:22
4
Solved
What's the best practise to add a row and a column header to a grid of subplots generated in a loop in matplotlib? I can think of a couple, but not particularly neat:
For columns, with a counter ...
Phrensy asked 12/9, 2014 at 15:56
7
Solved
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
...
Tundra asked 18/11, 2013 at 20:31
6
Solved
How do I increase the figure size for this figure?
This does nothing:
f.figsize(15, 15)
Example code from the link:
import matplotlib.pyplot as plt
import numpy as np
# Simple data to display in ...
Lunetta asked 8/2, 2013 at 10:41
6
How can I set the y axis range of the second subplot to e.g. [0,1000] ?
The FFT plot of my data (a column in a text file) results in a (inf.?) spike so that the actual data is not visible.
pylab.yl...
Tamah asked 17/5, 2010 at 13:12
2
Solved
I use a trick to draw a colorbar whose height matches the master axes. The code is like
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
a...
Sulfapyridine asked 28/10, 2013 at 0:44
2
Solved
I am making bar graphs in seaborn and I want to add some text to each subplot. I know how to add text to the entire figure, but I want to access each subplot and add text. I am using this code:
imp...
2
Solved
I'm adding a matplotlib figure to a canvas so that I may integrate it with pyqt in my application. I was looking around and using plt.add_subplot(111) seem to be the way to go(?) But I cannot add a...
Adey asked 29/7, 2016 at 15:39
9
Solved
I need to generate a whole bunch of vertically-stacked plots in matplotlib. The result will be saved using savefig and viewed on a webpage, so I don't care how tall the final image is, as long as t...
Eavesdrop asked 30/6, 2011 at 21:9
6
Solved
I want to plot 5 data frames in a 2 by 3 setting (i.e. 2 rows and 3 columns). This is my code: However there is an extra empty plot in the 6th position (second row and third column) which I want to...
Numbles asked 7/7, 2017 at 22:43
2
Solved
I'm having some trouble trying to change the figure size when using plt.subplots. With the following code, I just get the standard size graph with all my subplots bunched in (there's ~100) and obvi...
Brathwaite asked 12/11, 2013 at 15:0
3
Solved
I have the following code:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.cm as cm
img = mpimg.imread("lena.jpg")
fig, axs = plt.subplots(2, 2)
axs[0...
Protestantism asked 16/9, 2014 at 6:32
13
Solved
I am a little confused about how this code works:
fig, axes = plt.subplots(nrows=2, ncols=2)
plt.show()
How does the fig, axes work in this case? What does it do?
Also why wouldn't this work to...
Donaldson asked 30/7, 2015 at 14:31
4
Solved
I'm trying to construct a simple function that takes a subplot instance (matplotlib.axes._subplots.AxesSubplot) and transforms its projection to another projection, for example, to one of the carto...
Londonderry asked 26/11, 2015 at 15:30
3
Solved
I try to fit four images using matplotlib.pyplot like the following:
| plot1 | plot2|
| plot3 |
| plot4 |
Most examples I found cover three plots like these:
ax1 = plt.subplot(221)
ax2 = plt.su...
Chitchat asked 30/12, 2018 at 13:45
3
Solved
I'm hoping to adjust the space between subplots horizontally. Specifically between every second row. I can adjust every row using fig.subplots_adjust(hspace=n). But is it possible to apply this to ...
Godhood asked 7/8, 2018 at 0:19
1 Next >
© 2022 - 2025 — McMap. All rights reserved.