All Questions
Tagged with python-3.x matplotlib
6,313
questions
1
vote
1
answer
22
views
Changing text color in AnchoredText object
Is there any way of changing AnchoredText text color? I tried at.set_color(), at.patch.set_color(), tried also changing the prop through at.prop["color"] argument but this resulted in ...
1
vote
1
answer
35
views
Python: Using Figure.set_size_inches on a Figure contained in a tkinter GUI does not update the display
I am trying to embed a pyplot Figure object in a tkinter GUI and then later on change its size by calling the set_size_inches() method.
A miniumum (not) working example is provided below. ...
0
votes
0
answers
45
views
How to automate placement of fig.suptitle properly when displaying wide images with imshow in matplotlib?
The issue is that fig.suptitle and ax.imshow (with wide images) do not work well together. I understand that there are some aspect ratio (or something) hurdles to overcome due to the image being wide ...
0
votes
0
answers
20
views
how to make jupyter lab prepared by matplotlib interactive?
I am using this code
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import RectangleSelector
from matplotlib.patches import Rectangle # Import for rectangle visualization
...
0
votes
0
answers
25
views
How to connect a single NavigationToolbar to 2 Canvases (Matplotlib + PyQt5)
I am working on PyQt application that displays 2 FigureCanvasQTAgg inside of a QWidget. Currently, they are both linked to separate NavigationToolbar2QT objects but I would like to be able to control ...
1
vote
1
answer
90
views
Scrollbar in tkinter is not working with canvas
I am new to the python and tkinter, I want to create Dashboard using tkinter. I wrote the below code to add the graphs in tkinter using the Matplotlib. As I have 4 graphs and not able to fit all, so ...
0
votes
1
answer
49
views
Impossible to change drag and dropped (with tkinterdnd2) raster when plotting
When running the following Python code, I'm able to change the raster (by drag and dropping a new raster file) and display its name in anew window as many times as I want (without closing the ...
2
votes
1
answer
34
views
Matplotlib annotations do not appear at the proper distance in graph
I have subset of countries where I am comparing gdp per person and geographic latitude. I've developed code down here:
country_sub.plot(kind='scatter', figsize=(6, 4), grid=True, x=lat_col, y=...
1
vote
1
answer
41
views
Matplotlib arrows do not have proper length
I have subset of countries where I am comparing gdp per person and geographic latitude. I've developed code down here:
import matplotlib.pyplot as plt
plt.rc('font', size=12)
plt.rc('axes', ...
0
votes
0
answers
16
views
Multirow subplots with numpy arrays, AttributeError: 'numpy.ndarray' object has no attribute 'hist' [duplicate]
I've been attempting to create a 2-by-2 grid of plots using matplotlib. My data are numpy arrays, and I am trying to create histograms of the data. However, when I format subplots to output two rows, ...
0
votes
1
answer
23
views
Synchronising dual x axes in a dual (sub)plot in interactive Matplotlib 3.8.1?
Some years ago, I have posted the question Synchronising dual x axes in a dual (sub)plot in interactive Matplotlib? , which ended up having a working solution, which was behaved like this:
Thankfully,...
0
votes
0
answers
74
views
<Figure size 640x480 with 0 Axes> problem during plotting in matplotlib (No figure shows)
I am trying to plot a PDP plot using Matplotlib, but I find an error that indicates that figures were created but nothing was drawn on it.
enter image description here
This is my code:
def ...
8
votes
4
answers
3k
views
Randomly getting "ValueError: PyCapsule_New called with null pointer" when making plots with Python 3.12 fresh install on new PC
I use a suite of python 3.7 code for my work, generating various plots and fitting lines. It works perfectly fine on my old windows 10 machine.
However, I just got a new laptop and installed 3.12 on ...
0
votes
1
answer
27
views
Pyinstaller executable dependant on external python installation
I have a few python applications that use the same environment. The applications use matplotlib and Qt and as a result, a single file executable created using pyinstaller is around 200+ MB. I suspect, ...
0
votes
1
answer
68
views
Matplotlib animation script runs fine first time but gets stuck on re-runs until kernel is restarted
I'm trying to run an animation where a scatter plot is updated every timestep. I am working in a jupyter notebook in vscode (if relevant). The animation script, given below, runs great the first time ...