Linked Questions
146 questions linked to/from How to plot in multiple subplots
175 votes
5 answers
407k views
How to make two plots side-by-side [duplicate]
I found the following example on matplotlib: import numpy as np import matplotlib.pyplot as plt x1 = np.linspace(0.0, 5.0) x2 = np.linspace(0.0, 2.0) y1 = np.cos(2 * np.pi * x1) * np.exp(-x1) y2 = ...
49 votes
2 answers
113k views
How do I plot two countplot graphs side by side? [duplicate]
I am trying to plot two countplots showing the counts of batting and bowling. I tried the following code: l=['batting_team','bowling_team'] for i in l: sns.countplot(high_scores[i]) mlt.show()...
16 votes
1 answer
13k views
understanding matplotlib.subplots python [duplicate]
I have constructed a set of pie charts with some help Insert image into pie chart slice My charts look wonderful, now I need to place all 6 of them in a 2x3 figure with common tick marks on the ...
3 votes
2 answers
29k views
How add plot to subplot matplotlib [duplicate]
I have plots like this fig = plt.figure() desire_salary = (df[(df['inc'] <= int(salary_people))]) print desire_salary # Create the pivot_table result = desire_salary.pivot_table('city', 'cult', ...
4 votes
2 answers
14k views
Plotting on multiple figures with subplots in a single loop [duplicate]
I'm plotting on two figures and each of these figures have multiple subplots. I need to do this inside a single loop. Here is what I do when I have only one figure: fig, ax = plt.subplots(nrows=6,...
3 votes
2 answers
13k views
How to plot figures in subplots [duplicate]
I understand there are various ways to plot multiple graphs in one figure. One such way is using axes, e.g. import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.plot([range(8)]) ax.plot(...) ...
0 votes
1 answer
8k views
Matplotlib - How to place figures next to each other? [duplicate]
I have the following code: def compare(f,a,b,c,d,n,points): """Plots 2 figures - one of the color map of f, and one of the color map of a rectangle [a,b] x [c,d], split into n^2 subareas, ...
0 votes
2 answers
8k views
How to create multiple plots [duplicate]
I'm to Python and learning it by doing. I want to make two plots with matplotlib in Python. The second plot keeps the limits of first one. Wonder how I can change the limits of each next plot from ...
1 vote
2 answers
4k views
Create multiple plots using loop and show separate plot in one [duplicate]
I come across the answer from this forum and have a question. How to show separate plot in one plot. Try to use plt.subplots(1, 4) but not work. Here is the sample codes: import matplotlib.pyplot as ...
1 vote
2 answers
3k views
Vertically display two plots in python [duplicate]
I am learning visualization techniques in Python. I would like to plot two graphs vertically. Here is my code: import seaborn as sns import matplotlib.pyplot as plt kernel_avg_es_100 = sns.kdeplot(...
0 votes
1 answer
3k views
How to create two scatter plots in subplots [duplicate]
I try to generate two scatterplots (side by side), and the code for that in matplotlib is quite straightforward and self-explanatory. however, my dataset is somehow complex, meaning for each x value, ...
1 vote
1 answer
3k views
How to save multiple figures, not subplots, produced in a for loop as one figure? [duplicate]
In Jupyter Notebook, I write the following code, as MCVE: import matplotlib.pyplot as plt import numpy as np x1 = np.linspace(-1, 1, 50) for x in range(4): plt.figure() plt.plot(x1) plt....
0 votes
1 answer
2k views
Create multiple box plot at once in Python [duplicate]
How can we create mutiple boxplot at once using matplotlib or seaborn? For example, in a data frame I have numerical variable 'y' and 4 catergorical variables. So, I want 4 box plot for each of the ...
0 votes
2 answers
2k views
Python (matplotlib): Arrange multiple subplots (histograms) in grid [duplicate]
I want to arrange 5 histograms in a grid. Here is my code and the result: I was able to create the graphs but the difficulty comes by arranging them in a grid. I used the grid function to achieve that ...
1 vote
1 answer
3k views
Python matplotlib subplots: putting horizontal bar charts side by side and unwanted numerical labels on axes [duplicate]
Consider the following fake data: fake_data = pd.DataFrame( {"index": ["A", "B", "C"], 0: [0.1, 0.2, 0.3], 1: [2, 4, 6], 2: [1, 3, 5]} ) fake_data.set_index(...