72,876 questions
2
votes
1
answer
34
views
Matplotlib's ax.fill_between() function not working for 3D plots
I'm doing some data visualisation for an experiment on near/far field diffraction.
My goal is to essentially put several 2d plots in front of one another, pretty much identical to how this example in ...
-1
votes
1
answer
43
views
Saving matplotlib figures when running multiple subsequent python files via a .bat file on Windows
SET UP
I have multiple scripts that I execute with a .bat file, like so:
cd C:\\path\\to\\my\\project\\directory
echo Running script 1
"C:\\ProgramData\\miniforge3\\envs\\myenv\\python.exe" ...
0
votes
0
answers
70
views
Matplotlib polar plot has broken lines for satellite trajectories
When drawing satellite trajectories, the azimuth Angle jumps from 359° to 0°, causing the line segments to span the entire chart (break) instead of smoothly connecting.
python version:3.11.9; ...
0
votes
1
answer
85
views
Why different files produce same GNSS plots in my Python code?
I wrote a piece of Python code to read different GPS observation files (.24o) and navigation files (.24p), and generate polar plots of satellite trajectories. The goal is that the RINEX file can be ...
2
votes
1
answer
90
views
Matplotlib LaTeX text not respecting font family
I am trying to display a LaTeX-style equation in a Matplotlib plot using a custom font (Algerian). I want both the equation and the surrounding text to use the same upright (non-italic) font. Using ...
0
votes
0
answers
40
views
Matplotlib simple plot rendering is way off [closed]
When displaying a plot via Jupyter Notebook in VSC (newest version, 1.106.3) the graph is getting rendered in the right upper corner, and the labels in the lower left corner. I already restarted VSC ...
2
votes
1
answer
118
views
How do I make a matplotlib bar graph scale with the amount of items?
I am working on a small project and it is my first time using matplotlib, and I am struggling with how to make my bar graph look better with more inputs. The whole idea of the program is to read text ...
Advice
0
votes
2
replies
121
views
Analysis of a tapering function
On Window function - Wikipedia tapering functions are plotted using two different styles. One shows curve (samples) and the other Fourier transform (bins).
I've prepared two tapering functions based ...
2
votes
1
answer
96
views
How to connect a callback to "Reset original view" event in Matplotlib?
I would like to connect onTool() callback to "Reset original view" event, i.e. clicking on "home" icon in the bottom left corner of Matplotlib figure. I tried several options ...
3
votes
1
answer
81
views
Why the initial figure dimensions are wrong in this matplotlib script?
This Python 3.13 script with Matplotlib 3.10.3 run on 1200x1600 display:
import matplotlib.pyplot as plt, numpy as np
fig, ax = plt.subplots()
plt.tight_layout(pad=0.01)
fig.canvas.manager....
3
votes
1
answer
110
views
rasterized, dpi, bbox_inches='tight' and axins mess up the plot in a pdf
When I run the code below, the plot in the PDF is messed up. The content of the plot and the colorbar are shifted down to the left, as shown in the attached screenshot of the PDF.
import matplotlib....
0
votes
0
answers
60
views
Rendering matplotlib figure in VSCode (Jupyter) like fig.savefig
Problem
When saving a matplotlib figure using fig.savefig(), the figure looks different from when the figure is rendered in a Jupyter Notebook.
Question
How can I render a static (non-interactive) ...
1
vote
1
answer
55
views
Boxplot with scatter points: preventing overlap when categories are similar
I am trying to create a boxplot with different categories and overlay scatter points on top of it. The problem I am encountering is that when the results across categories are very similar, the ...
3
votes
2
answers
101
views
How to ensure cartopy features are rendered after setting matplotlib Axes box aspect?
I have a function that will produce a map when given a DataFrame containing lat/lon coordinates. Regardless of the shape of the track that can be drawn from coodinate pairs and timestamps, I want to ...
1
vote
0
answers
64
views
OpenCV-Python with PyQt5: Qt platform plugin "xcb" error and cv2.imshow not working on Linux
I'm trying to use OpenCV with PyQt5 on Linux, but encountering Qt compatibility issues. When I install opencv-python, I get Qt platform plugin errors that prevent the application from starting. When I ...