72,826 questions
Advice
0
votes
5
replies
81
views
End Simulation on surface collision
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 ...
-3
votes
2
answers
73
views
How to create a 2D graph from data in a file using matplotlib in Python?
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 ...
1
vote
0
answers
41
views
What is wrong with my PIL looped image paste?
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 ...
Best practices
1
vote
2
replies
96
views
Using matplotlib to build report of survey responses, what is the most efficient way to tally likert scores?
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 ...
Tooling
0
votes
2
replies
82
views
I am working on programming a Cartesian & Polar Parametric Grapher with python, any library recommendations?
I saw this website: https://www.calculators-math.com/graphers/parametric-curve/
I found it very interesting and I would like to create something like it, I saw some libraries being used to make a ...
0
votes
0
answers
49
views
Preventing matplotlib ax.annotate from overflowing with WCS projection
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 ...
1
vote
1
answer
83
views
how to start colorbar at value 0 without changing the coloring
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'...
3
votes
2
answers
82
views
Seaborn plot with lines inbetween pairs of data points showing value differences
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="...
1
vote
1
answer
92
views
Add outline to the 3D barchart
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 ...
Advice
0
votes
4
replies
75
views
How does one make a player diagram/visualization like the one below within Python?
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 ...
Best practices
0
votes
1
replies
62
views
How do I implement a cylindrical grid for a 3D plot?
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 ...
Tooling
0
votes
0
replies
32
views
Creating custom 3D plots with annotations confined to planes
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 ...
3
votes
0
answers
103
views
How to plot contour onto the 'walls' of a 3D histogram Python
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 ...
3
votes
1
answer
61
views
Boxplot Min/Max Values and Overlaying Points Issues
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 ...
1
vote
1
answer
79
views
Smooth colormap in matplotlib
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 ...