All Questions
Tagged with matplotlib plot
7,954 questions
0
votes
1
answer
86
views
How to annotate with label in middle?
When I plot the following code with 3 subplots using matplotlib,
import numpy as np
import matplotlib.pyplot as plt
# ======================================
# Base ellipse parameters
# ==============...
0
votes
0
answers
48
views
matplotlib qt5Agg buttons clipped on plotting GUI
I am struggling to get matplotlib to return an interactive window on the plots i am generating. I am on ubuntu 25.04 matplotlib 3.10.6. The control buttons are clipped both on the window as well as ...
0
votes
2
answers
46
views
Python matplotlib showing jagged graphs for constant value functions
I was trying to plot a function with absolute values and it's piecewise counterpart, but matplotlib was ploting the function with jagged corners.
Here is my full code:
import matplotlib.pyplot as plt
...
0
votes
1
answer
146
views
how can I access particular y and x axis using ax = fig.add_subplot(3, 3, i +1), for a loop on i?
It seems accessing axis is easy with
fig, ((ax1, ax2,ax3,ax4)) = plt.subplots(2, 4,figsize=(10,8),layout='tight')
subfigs = fig.subfigures(2, 4)
For example, if I want the ticks (labeling too) on the ...
2
votes
1
answer
84
views
How can i set the ticks of ax and ax2 to the same position but I have different scales?
I have this python code snippet that sets the ticks of the two y-axes. But I can't figure out how I can synchronize the axe's scales.
if y_data_left:
all_left = pd.concat([y for _, y, _, _ in ...
1
vote
1
answer
99
views
How to edit title/axes of already compiled matplotlib plots
I expect the answer is "not possible". I am compiling some matplotlib plots that take a long time to produce. The plots are generated based on data that also takes a long time to produce, ...
2
votes
1
answer
92
views
Change of basis for log-log plotting, grid in log-scale
I want to plot in log scale in both axis, when using the default base, the graph plotted is correct, but since the y variation of my data is small I would like to change for base=2, when I does this ...
0
votes
1
answer
82
views
In matplotlib 3D line plots, how to ensure lines that are behind actually appear behind those drawn later?
I am plotting families of orbits in python using matplotlib and the add_subplots() routine:
fig=plt.figure()
ax=fig.add_subplots(projection='3d')
I then loop through my list of [X,Y,Z] series and ...
1
vote
0
answers
104
views
PCA with direction arrows showing genes associated with samples
I’m trying to reproduce a PCA biplot where
dots = samples coloured by the column sample in pb.obs
arrows = genes, pointing toward the region(s) of the plot where each gene is most highly expressed.
So ...
0
votes
1
answer
114
views
How to set seaborn boxplot color and fill using two variables?
I'm using seaborn to plot a pandas dataframe. I'm currently able to set the color of the boxplot according to one variable ('G') but I also want to be able to set the fill of the boxplot according to ...
0
votes
0
answers
56
views
How to address line (or similar) elements in a matplotlib window
How do I address a matplotlib element in a window?
In this code, a window is created and three lines a re drawn. with the "m" key you can add another line, "l" lists all lines with ...
1
vote
2
answers
89
views
Extrusion of a curve in Matplotlib
I am trying to "trivially" extend a curve in the third dimension, such that the blue curve in the figure below becomes the boundary of a sheet, and the endpoints of the boundary are $x_1$, $...
0
votes
1
answer
81
views
log-log time series plot with event markers
I want to create a log-log plot showing the growth of publications over time (papers/year), similar to scientific figures like Fig. 1a in "A Century of Physics" (Nature Physics 2015).
...
0
votes
1
answer
68
views
Basemap plots in Matplotlib have cutoff map boundary lines
When trying to create a grid of maps in matplotlib using the Basemap toolkit, I noticed that the line that bounds the map projection is cut off on all four sides.
Look at the following minimal example ...
0
votes
1
answer
32
views
Why can I not get a continous curve when manually splitting a fitted curve into two parts?
I aim to fit the following function to my data:
def P(t, CP, Pan, tau):
P_val = CP + Pan / (1 + t / tau)
P_val = np.where(t >= 900, P_val - 0.8 * np.log(t / 900), P_val)
return P_val
...