72,879 questions
-1
votes
0
answers
39
views
How to recreate Google Quantum AI Plots? [closed]
I'm analysing plotting styles in quantum computing papers (specifically Google Quantum AI publications) and trying to understand how the circuit diagrams and plots are created. Here's an example:
The ...
Advice
0
votes
2
replies
30
views
How do I set the matplotlib co-ordinate system to SVG
A synopsis of my code.
import matplotlib.pyplot as plt
import shapely.plotting
from shapely.geometry import Polygon
facing = 'north'
shape = 'triangle'
polygon = Polygon(((1, 17), (9, 1), (17,...
0
votes
1
answer
47
views
Crop extra white-space on matplotlib picture
I made a "gauge" image using the following code:
taux = 91
# Plot
fig, ax = plt.subplots(figsize=(7.5,5), subplot_kw=dict(polar=True))
ax.set_theta_zero_location("W") ...
1
vote
1
answer
77
views
How to expand equal-aspect data limits in one direction only?
I've been trying to set equal data aspect ratios in matplotlib with ax.set_aspect('equal', 'datalim') (aka ax.axis('equal')), while preserving lower bounds/limits, aka anchoring one side of the data ...
4
votes
1
answer
93
views
Tick direction of 3D plot in Matplotlib
In Matplolib, it is possible to change the direction of the tick of 2D plots with tick_params parameters
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
fig ...
1
vote
2
answers
120
views
Plotting Y data vs X data with alternating colors for each section in Python
I have what might be a simple problem, but I’ve been stuck on it for several days.
I have a dataset that looks like this:
Exp Site Hole Core Type Sect A/W ... Instrument Instrument ...
-2
votes
0
answers
72
views
Numpy's np.polyfit() returns matching types Error? [closed]
I have a dataTable that is a list of lists. Every one of those lists is a list of different data. The first list containes the year, the second is data about 'poverty' for every one of those years, ...
1
vote
1
answer
57
views
How to limit the number of displayed xticks in pyplot when x values are strings
I have a scatterplot in pyplot where the x-values are necessarily strings. Is there an easy way to limit the number of xticklabels that pyplot will show?
I am not referring to specifying the xticks ...
2
votes
1
answer
57
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
64
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
81
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
96
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 ...
3
votes
1
answer
105
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 ...
2
votes
1
answer
134
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
124
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 ...