All Questions
1,137 questions
0
votes
1
answer
42
views
Matplotlib figure with 2 animation subplots: how to update both
I'm trying to vizualize simulation results with a figure containing 2 subplots using matplotlib pyplot. Both should contain animation: one uses netgraph library (it's a graph with nodes showing flows ...
0
votes
1
answer
96
views
Aligning matplotlib subplots one with stacked bar plot and another with line plot using matplotlib in Python [duplicate]
I have 2 dataframes as follows:
df1.to_dict() results in
{'Peak Demand PES': {2023: 124126.91,
2025: 154803.41,
2030: 231494.66,
2040: 483217.66000000003,
2050: 1004207.86},
'Peak Demand TES':...
0
votes
2
answers
42
views
Plot with 8 subplots where 4x4 with horizontal space
I am trying to make a plot where I just want some distance between the first and second set of plots. Basically when you plot below, you can see the y-axis values off ax5 and ax7 there that is where I ...
0
votes
1
answer
58
views
How to use the same colour map and scale for two different graphs plotted together (using custom colormap)
I have 3 data sets: height, data1 and data2, where all are different and I want to plot height vs data1 and height vs data2 as a (1,2) subplot using pcolormesh and have them share a colorbar.
The ...
0
votes
1
answer
44
views
To plot variable number of plots with variable number of graphs from Pandas grouped by some columns
I've been dealing with Python for the last few months and it still a little bit irritate me :)
But hope someone can explain how to plot some subplots from dataframe grouped by 2 columns using ...
0
votes
2
answers
68
views
Align yaxis label spanning two axes with yaxis labels of one axes in subplots
I have a plot with 3 subplots: the top plot is larger than the two subsequent plots. They all share the same x- and y-axis. However, the ylabel is rather long, so the ylabels of the two bottom plots ...
0
votes
1
answer
41
views
How do I create a secondary axis based on on a complex conversion?
I am trying to create a secondary axis for my plot. I can get all of my lines to plot on the graph (y1 to y14) and all y values are in the same units. The conversion to a secondary unit is essentially ...
0
votes
1
answer
42
views
How to superimpose the rotated subplot on the another sublot?
I would like to release such configuration of plots as it presented on the picture:
The next parameters have to be variable:
Position of subplot origin point
Rotation angle of subplot
Size of ...
0
votes
1
answer
33
views
Matplotlib - Fix bar chart, using subplots, and inserting labels per each bar
I am creating a bar chart with the following code. I am getting the text I need but the format is incorrect, due is overlap with the titles and part of the first subplot. Could you please tell me how ...
0
votes
1
answer
30
views
Move Span center to click position not showing range when clicking in subplot with shown range
I have created a 2 plot subplot. Selecting the range in both subplots works fine. Clicking into the upper subplot (the zoomed plot) shifts both views fine, but when clicking in the lower (total view) ...
2
votes
1
answer
38
views
How to increase the space between the subplots and the figure?
I'm using a python code to plot 3D surface. However, the z-axis label get cut by the figure. Here is the code :
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure(figsize=(12, 10), ...
0
votes
1
answer
92
views
How to create single column 3x1 plot in a 3x2 subplot?
I want to create a plot with 2 columns, with the 1st one has only 1 plot and the 2nd one has 3. I try to set it up by using the following code
import matplotlib.pyplot as plt
def format_axes(fig):
...
0
votes
1
answer
57
views
Set suptitle and y-ticks in subplot
I have two different functions, each producing a plot.
list_soal = ['SalePrice', 'GrLivArea', 'GarageArea']
# fig,ax = plt.subplots(1, 3, sharey=True, figsize=(14,4))
def function1(ax):
for i in ...
1
vote
1
answer
118
views
How to scale subplots including images with different aspect ratios?
A minimal version of my problem is the following plot. How do I scale the right panel to have the same height as the left one?
import matplotlib.pyplot as plt
import numpy as np
rnd = np.random....
0
votes
2
answers
86
views
How can I prevent Matplotlib from autoscaling images to the same size in subplots?
I’m trying to display three images of different sizes side-by-side using Matplotlib. I want each subplot to maintain the original size of the images without auto scaling them to be the same size.
...