72,754 questions
Score of 2
2 answers
264 views
Trying to Change A Pixel in Python
I'm trying to change a pixel to red. However, when I run the code, the pixel remains unedited. Can you help?
import cv2 as cv
import os
import matplotlib.pyplot as plt
def readAndWriteImage():
...
Score of 9
1 answer
945 views
Conway's Game of Life: How can we colour the cells based on number of neighbours? (change number of neighbours to age of cells)
I've coded Conway's Game of Life in NumPy and Matplotlib.
It works, but I want to alter the colours of the cells based on their numbers of neighbours. My code does set background colour and cell ...
Score of 4
2 answers
180 views
How can I boxplot values that wrap around using matplotlib?
I want to show the distribution of angle estimations using a boxplot. The problem is that angles wrap around (I chose +-180° as the wrapping point, but the same applies to 0/360°).
Matplotlibs boxplot ...
Score of -2
0 answers
157 views
How do I plot this function for all values of the numpy array?
I want some straightforward way to model a for all values of the array like in a for loop. the only way I found was using filtered arrays which is very very tedious.
This function takes a number turns ...
Score of 2
1 answer
120 views
Plot grid shifted against data points
I have defined a plotting method (in a class, where self.steps is a list of lists of dictionaries, containing different "feature": value associations. Also self.path_alignments here is a ...
Score of 0
1 answer
105 views
Data Labels on Matplotlib and Saving graph to a pptx
I was creating visuals/graph using matplotlib. So far, I need to create a data labels with the follow data sample.
cellvalue1 = [1,2,3,4,5,6,7,8,9,10,11,12,13]
cellvalue2 = [1,2,3]
fig, ax = plt....
Tooling
1
vote
1
replies
117
views
What Python packages/libs are your favorite for automating prod level report building (graphs, charts)
I realize this is a broad question and will depend case by case. Really just looking to explore new Python libraries and pandas since there are so many out there! My main tasks involve moving data ...
Score of 0
3 answers
214 views
Very high uncertainty in a parameter using curve_fit() on exponential relation
Plots of different graphs fitted using the same function
I tried fitting my plots, which are supposed to show a negative exponential using the same function, but predictions for L_infty are really ...
Score of 4
1 answer
97 views
Same legend label for different plot in a same graph
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(1, 6, 10)
plt.figure()
for i in range(10):
T = i + 20
Fit = 4 * x - ( 2 + i)
noise = np.random.normal(loc=0, scale=1.0, ...
Score of -1
1 answer
105 views
"import matplotlib.pyplot as plt" & "import meteostat as ms" script not running
In my Visual Studio Code is not importing these programs with the following script
import matplotlib.pyplot as plt
import meteostat as ms
Are there "pandas" or "pip" commands I ...
Score of 4
1 answer
165 views
plt.show() does not display plots when running python venv through crontab
I have a python script, test.py:
import matplotlib.pyplot as plt
plt.plot()
plt.show()
plt.savefig("/home/user/Desktop/test.png")
When I run it in a virtual environment using this,
user@...
Score of 0
1 answer
78 views
calplot height does not match Plotly chart height in two-column layout
I am building a Streamlit dashboard with two columns:
Left: a Plotly pie chart
Right: a calendar heatmap using calplot
My issue is that I cannot make both visualizations have the same height. Even ...
Best practices
2
votes
3
replies
111
views
Approach to graphing with matplot
So I have the following problem:
I have several pandas Series's which I want to graph using matplotlib's subplot.
I came up with the following code
items = [expcat, inccat, expmonth, incmonth]
fig, ...
Tooling
1
vote
3
replies
123
views
Colorbar not completely filled
I have a contour plot here with data that ranges from 10 to 60 ish but i need the colorbar to show from 0 to 330 (for comparison with a similar plot), I've had a few python classes but its been mostly ...
Score of -1
2 answers
117 views
Why can't I turn off legend warnings in Matplotlib?
Does anyone know why this isn't working?
plot.py:
355 logging.getLogger('matplotlib.legend').setLevel(logging.ERROR)
356 plt.set_loglevel("error")
357 plt.legend()
I'm getting this:...