72,835 questions
0
votes
1
answer
43
views
Matplotlib update AnnotationBBox position
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 ...
1
vote
1
answer
28
views
"AttributeError: 'FigureCanvasInterAgg' object has no attribute 'tostring_rgb'" in pyplot.show()
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 ...
0
votes
1
answer
54
views
Locate where a map boundary is in the world with my created shapefile
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 ...
4
votes
1
answer
79
views
How to create a class that generates auto-updateable plots
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-...
-3
votes
0
answers
49
views
Creating a figure with matplotlib imshow with native resolution of the array [duplicate]
I am currently creating figures with one or more imshow plots.
I would like to get a native plot of one of those imshow plots.
To my understanding I would need to calculate the figure size, with ...
2
votes
1
answer
31
views
Matplotlib plot window does not stay minimized
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 ...
-2
votes
0
answers
28
views
How do I add a legend to for pixmapped image [duplicate]
I have a 2D array of integer data that I am plotting with matplotlib's axes interface (not the pyplot interface). When I use ax.imshow I get the plot I am looking for. The built in colorizer handles ...
1
vote
1
answer
51
views
python Plot Swaps Colours in Subplot — How to make one colour stick to one data set?
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 ...
Best practices
2
votes
4
replies
54
views
Visualizing categorical features with severe Class Imbalance for ML: Absolute Counts vs Normalized Percentages?
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 ...
Tooling
0
votes
3
replies
46
views
How to better emulate this broken line plot with matplotlib or seaborn?
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))...
1
vote
1
answer
68
views
how to carryon after matplotlib has been called
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(&...
1
vote
1
answer
116
views
Jupyter Lite outputs a blank file when I use plt.savefig()
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 ...
1
vote
2
answers
88
views
Why does Matplotlib DatetimeIndex plot misalign dates?
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 ...
1
vote
1
answer
52
views
Colorbar tick locations not correct
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 ...
0
votes
1
answer
74
views
Show the value at hovered position (x,y) with interactive pcolormesh plots
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 ...