Skip to main content
Filter by
Sorted by
Tagged with
Tooling
0 votes
2 replies
27 views

I am running matplotlib in Python. I have a histogram showing data from 36 different channels, each colored by a cmap gradient. I want to be able to put a gradient in my legend, possibly through a ...
Andreas Pettersson's user avatar
5 votes
2 answers
101 views

How to fix these kinks in the norm_pan and norm_tau curves? I tried using a quite high resolution and logarithmic spacing when defining t, but this did not fix the problem. import numpy as np import ...
Márton Horváth's user avatar
Tooling
0 votes
2 replies
59 views

I'd like to do something like pyplot.fill_between but I want to shade areas where a plot goes above a threshold (0.5) in the x-axis. For example, here's a plot I produced using pyplot.fill_between and ...
Petra's user avatar
  • 385
Advice
0 votes
2 replies
74 views

I have a while loop that is running 5000 times a second. Each time it runs it recalculates a whole ton of variables and then adds the value of a couple of those varibles to their own lists. After a ...
A Four Headed Deer's user avatar
Advice
0 votes
5 replies
98 views

I'm making an orbit decay simulation and I don't know how can I make the simulation stop/break when the object collides with the surface. It keeps simulating inside the planet's surface and doesn't ...
Diniz Vitor's user avatar
-3 votes
2 answers
88 views

I am working on a Python project and I need to generate a 2D graph using matplotlib. The data is stored in a text file with two columns (x and y values). Example file: 1 10 2 20 3 30 4 40 How can I ...
Mihaela Diana's user avatar
2 votes
0 answers
50 views

I have script that loops over a set of json color themes, uses seaborn and matplotlib to generate a labeled swatch and then saves it to a buffer. I want to paste the buffer into a new PIL.Image but ...
zoof's user avatar
  • 181
Best practices
1 vote
2 replies
114 views

I am building out functionality in an existing app for a user to upload an excel file to plot out responses for survey questions. There are 4 likert questions with 2 comment response question. The ...
Fennario's user avatar
0 votes
0 answers
53 views

A scatter plot with an astropy wcs projection is limited to just the xlim/ylim of the axis, even if there are points outside that range: import numpy as np import matplotlib.pyplot as plt import ...
Matthew's user avatar
  • 2,310
1 vote
1 answer
88 views

I have aquestion about the limitation of my colorbar. in my first plot, i want to show values of climate data from zero to maximum and in my second plot from minimum to maximum. unfortunately, I didn'...
Kay 's user avatar
  • 13
3 votes
2 answers
91 views

I have the following plot made with Python seaborn: The plot I have: Obtained by this piece of code: plot = sns.scatterplot(data=by_sent_type, s=50) plot.set(xlabel="pair", ylabel="...
Ivy's user avatar
  • 33
1 vote
1 answer
95 views

So I worked with ChatGPT to create a 3D bar chart with a gradient effect in Python. I met a problem that I cannot add outlines to bars. If I do so, it will make the bar transparent. GPT says it is a ...
Kevin's user avatar
  • 607
Advice
0 votes
4 replies
75 views

I'm quite the baseball fan, and if you are as well, you've probably seen the X profile of the user Pitcher Profiler creates these awesome post-game reports for players, and one of the visualizations ...
Jole77's user avatar
  • 1
Best practices
0 votes
1 replies
64 views

I want to plot a 3D curve showing the X-Y grid in polar coordinates. Here's a sketch and my script that generated it: from math import cos, cosh, floor, pi, sin, sinh import matplotlib.pyplot as ...
troy's user avatar
  • 51
Tooling
0 votes
0 replies
33 views

I want to create a 3d plot that only shows data and annotations in the xy, xz, and yz planes. Especially, annotations should be fixed to these planes as well, and should not rotate out of them when ...
user2224350's user avatar
  • 2,336
3 votes
0 answers
105 views

For the context, I want to represent spatial-temporal evolution of a heatwave event. In this example, a heatwave is defined when the daily temperature is higher than the temperature threshold and the ...
Bastounator's user avatar
3 votes
1 answer
66 views

I am trying to plot various isotope fractionation values in a boxplot. I have most of the code but I'm having two main issues: The min and max error bars don't show up for every box and Adding a ...
user32351733's user avatar
1 vote
1 answer
83 views

Question: How can you make a colormap in matplotlib to render smoothly on a display? Let me clarify. This is the code: import matplotlib.pyplot as plt import numpy as np import matplotlib.colors as ...
Buru Cristian's user avatar
2 votes
2 answers
80 views

I'm trying to add an extra tick mark to my matplotlib x-axis if it isn't already there, and then color the tick mark in either case. Is my logic wrong? I don't understand the behavior that is ...
Oatmeal's user avatar
  • 269
1 vote
2 answers
79 views

I am trying to create a masking array for global map using shapefiles. I managed to get the right shapefile to work in a way that I can now plot an area that I want using matplotlib polygon. But, I ...
Redshoe's user avatar
  • 395
2 votes
1 answer
91 views

To clarify this is a homework help question. I have started it already and I am running up against a brick wall when it comes to coding it. We are to use what I said above to generate a sine wave ...
Jassen Buerano's user avatar
Advice
0 votes
3 replies
29 views

I am trying to plot the time evolution of the function y(x, t) on a 2-D plot in matplotlib where t represents time and x one spatial dimension. I have y and x parameterized as functions of a parameter ...
Thanos's user avatar
  • 101
1 vote
1 answer
78 views

I am trying to create an animation of two plots side by side on which on the first plot I display a series of images and on the second plot a log log representation of data corresponding the image ...
daniel vito's user avatar
7 votes
1 answer
133 views

I have an application in python that embeds a matplotlib.Axes3d in a QWidget to draw 3D curves. The problem is that when resizing or there is a lot of space in the window, matplotlib cuts the plot ...
Daniele C.'s user avatar
0 votes
1 answer
66 views

I'm trying to display labels in a 3D plot. My final goal is to display a tiny version of an image/texture at the coordinates of its average color in Lab space. After multiple failed attempts, I ...
herhor67's user avatar
  • 119
1 vote
1 answer
57 views

While using the following code: from matplotlib import pyplot from sarpy.visualization.remap import Density from sarpy.io.product.converter import open_product from sarpy.io.complex.converter import ...
Przemysław Bezeg's user avatar
2 votes
1 answer
97 views

I made a shapefile containing the boundaries of all the worlds countries and some of their regions (like the states in the US, Canadian provinces, etc). I've been trying to set a boundary box of my ...
Gabe Mathews's user avatar
4 votes
0 answers
88 views

I want to create a class that will create updateable plots. I plan on having 8-16 figures in one window, so it would be nice to have a class that would initiate these for me. These graphs will auto-...
Deepolisnoob's user avatar
2 votes
1 answer
35 views

I am creating a dashboard using matplotlib. The following is my python3 code. When I minimize the matplotlib plot window, the window jumps back up and the window does not stay minimized. What should I ...
pikachu's user avatar
1 vote
1 answer
59 views

I am trying to plot some data from a Markov Chain Monte Carlo run, using getDist, which (I assume) uses matplotlib under the hood for plotting. There is no error message or anything, and it produces a ...
kalle's user avatar
  • 207
Best practices
2 votes
4 replies
67 views

I am performing Exploratory Data Analysis (EDA) on a medical dataset (Primary Biliary Cirrhosis) to select features for a multiclass classification model. My target variable is Stage (1, 2, 3, 4). The ...
DJTrevor Philips's user avatar
Tooling
0 votes
3 replies
52 views

What I want to achieve is something as below: I have found the brokenaxes package here, and tried it: from brokenaxes import brokenaxes import numpy as np bax = brokenaxes(xlims=((0, 10), (195, 200))...
Explorer's user avatar
  • 117
1 vote
1 answer
70 views

I am stuck after displaying using matplotlib because I can not seem to figure out what code to use to continue after using matplotlib. Specifically, I use: plt.figure(figsize=[10, 10]) plt.title(&...
user3236841's user avatar
  • 1,438
1 vote
1 answer
129 views

I'm writing a Python code that's supposed to create a graph and export it as a vector PDF file. I'm using Jupyter Lite at jupyter.org. I've successfully created the graph, but when I try to export it ...
Rain's user avatar
  • 121
1 vote
2 answers
91 views

Why does matplotlib round to the nearest month sometimes and not other times depending on the order lines are plotted and which dates are used. ax3 and ax4 are particularly interesting because they ...
Brandon's user avatar
  • 546
1 vote
1 answer
55 views

I'm making a protein secondary structure plot, at first with trivial data: import matplotlib.pyplot as plt fig, ax0 = plt.subplots(1,1, layout = "constrained") from matplotlib.colors import ...
con's user avatar
  • 6,265
0 votes
1 answer
85 views

I find the coordinates shown below (in the form: (x, y) [z]) very useful for interacting with the data. Unfortunately, librosa.display.specshow does not show the value at (x, y), rather, only the ...
egaznep's user avatar
  • 33
2 votes
1 answer
125 views

I struggle with typechecks using matplotlib.pyplot.subplot_mosaic. I have create the following fuction, which generates the mosaic pattern and the per_subplot_kw: def create_mosaic(num_rows): def ...
MaKaNu's user avatar
  • 1,108
Advice
0 votes
2 replies
62 views

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,...
snow6oy's user avatar
  • 715
0 votes
1 answer
61 views

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") ...
YamiOmar88's user avatar
  • 1,496
1 vote
1 answer
89 views

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 ...
casblaauw's user avatar
4 votes
1 answer
125 views

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 ...
Thomas Bernat's user avatar
2 votes
2 answers
215 views

I have what might be a simple problem. I have a dataset that looks like this: Exp Site Hole Core Type Sect A/W ... Instrument Instrument group Text ID Test No. Sample ...
Weiss's user avatar
  • 333
1 vote
1 answer
68 views

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 ...
Alex V.'s user avatar
  • 550
2 votes
1 answer
82 views

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 ...
KaasBaasKoning's user avatar
-1 votes
1 answer
80 views

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" ...
bismo's user avatar
  • 1,655
0 votes
1 answer
101 views

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 ...
Aria's user avatar
  • 1
3 votes
1 answer
151 views

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 ...
taiwan12's user avatar
  • 123
1 vote
1 answer
154 views

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 ...
AP_'s user avatar
  • 33
Advice
0 votes
2 replies
129 views

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 ...
Juha P's user avatar
  • 337

1
2 3 4 5
1457