215 questions
0
votes
0
answers
27
views
Matplotlib Slider: function set_val does not work following standard prescriptions?
I am a beginner with the Slider tool and retrieved a code which used to work but does not anymore. I found a similar code here to test the Slider tool in this answer which provides a self-contained ...
2
votes
1
answer
90
views
Python Threading + Tkinter: Event.set() doesn't terminate thread if bound to Tk window closing
I'm writing an app that generates a live histogram to be displayed in a Tkinter window. This is more or less how the app works:
A Histogram class is responsible for generating the embedded histogram ...
2
votes
1
answer
48
views
matplotlib - Unable to update plot with button widget
The code below draws a button and an axes object in which it's meant to print out the number of times the button has been pressed. However, it never updates the axes with the number of presses.
from ...
0
votes
0
answers
30
views
No new plot after interacting with matplotlib slider
So first, here is my code:
%matplotlib ipympl
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button
def ODE_r(x, t, params):
r, d1t_r =...
0
votes
1
answer
287
views
How can I plot an interactive matplotlib figure without the figure number in a Jupyter notebook?
I am using matplotlib with the %matplotlib widget in a Jupyter lab notebook. When I display a figure, there is "Figure 1" displayed just above it. How can I get rid of it?
I have found that ...
1
vote
0
answers
36
views
Matplotlib: Rotate label on a vertical slider
So, in this link you can find an MRE that generates a plot with sliders, and one of them is vertical. The link is from matplotlib's docs.
Now, the question is the following: You can see that the ...
0
votes
0
answers
45
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
...
1
vote
1
answer
1k
views
Matplotlib interactive figures with streamlit
I am trying to display matplotlib interactive figures in Streamlit generated pages i.e. to display the pan/zoom and mouse-location tools.
I know there are other ways to make figures interactive that ...
0
votes
1
answer
76
views
Python matplolib, plotting value every 2H per day
I’m having trouble with plotting a certain way in python with matplotlib.
I’m making an interface where I’m receiving data from a chip, the data is then saved in csv format, one csv per day (name of ...
0
votes
0
answers
57
views
Sectorized antenna with azimuth (Bearing in degrees) and Lat-Long information
How to create shape to show sectorized antenna with azimuth (Bearing in degrees) and Lat-Long information. This is to represent a cellular site. Normally a cellular site is from 1 to 6 sectors ...
0
votes
0
answers
417
views
Can't capture Mouse and Click events from Jupyterlab 4.1.2 matplotlib interactive plot
I tried the Jupyter notebook example for Matplotlib Event Handling and seemed to get no results.
I downloaded the jupyter notebook from https://matplotlib.org/stable/gallery/event_handling/coords_demo....
0
votes
1
answer
50
views
how to update grid parameters for figure & canvas created with matplotlib.figure & matplotlib.backends.backend_qt5agg
I need to update grid parameters (visible, which, axis, **kwargs) to customize the major and minor grid lines style. i tried using plt.grid(which='minor', linewidth=0.5, linestyle='dotted') but it did ...
0
votes
0
answers
93
views
Updating animation with slider
I'm currently developing an animation featuring a double pendulum, and I'd like to incorporate sliders to enhance user interaction. These sliders are designed to control the two initial angles of the ...
-1
votes
1
answer
166
views
navigationtoolbar pan & zoom buttons/icons DO NOT highlight background when active in matplotlib
i have built an application in python using PySide6 & Qt designer where i added a matplotlibWidget to window main_plot_container and NavigationToolbar2QT to a tb_frame that sits on top of ...
0
votes
2
answers
131
views
How to dynamically change the sheet type theme during runtime
I am working on dynamically changing matplotlib style sheet during runtime. I have initialized a class for matplotlib widget and chosen two styles from matplotlib style sheet reference - let's say ...
0
votes
1
answer
118
views
matplotlib slider not working when embedded in pyqt6 application
I can't get the matplotlib slider to respond inside a PyQt6 application. Here is a sample program. I know there is no binding on the slider (that's not the problem). The problem is the slider itself ...
1
vote
1
answer
101
views
How to use a dropdown widget to highlight selected categorical variable in stacked bar chart?
I am learning matplotlib and ipywidgets and attempt to design an interactive bar chart, such that the selected category can be highlighted.
Data Example
Assuming I have a dataframe:
import pandas as ...
0
votes
1
answer
71
views
Closing main window doesn't stop tkinter app process
I try to implement matplotlib chart into tkinter app and it works but after closing main window (m) the process is still going and cant stop it without closing the console. Why?
import matplotlib....
0
votes
1
answer
70
views
matplotlib multiple dependent sliders
i have two sliders setup, one to control the position on the plot and one to control the scale of the x-axis. this works great, except i am using a different dataframe to control the slider than what ...
1
vote
1
answer
112
views
Question about format of return values of pythons matplotlib.pyplot SpanSelector
I am trying to select a range of data in a matplotlib plot and got stuck with the return values of SpanSelector:
from io import StringIO
import matplotlib.pyplot as plt
from matplotlib.widgets import ...
0
votes
0
answers
50
views
Event loop already running error with widgets
Please help with the solution to the problem:
QCoreApplication::exec: The event loop is already running.
I need to create a window with a button. When you click on the button, a new window opens ...
0
votes
1
answer
1k
views
Using a Slider from matplotlib.widgets doesn't work
So i want to change a graph in real time using a slider.
I tried learning it this bottom code is from youtube where it worked.
When i run it though, all this does is shows a picture of a graph with a ...
0
votes
0
answers
280
views
Combine matplotlib slider and funcanimation
I have an animation working well with FuncAnimation. My goal is to change a parameter with a slider and update the animation instantly. I don't know how to combine both. You'll find my code down here, ...
1
vote
0
answers
427
views
Customise the icons of the toolbar created using NavigationToolbar2Tk
I want to customise the icons (like home, back, forward, pan etc) on the matplotlib toolbar. In this case I am writing a GUI with tkinter with embedded pyplot plot in the widget of the GUI and create ...
2
votes
2
answers
747
views
Matplotlib sliders on multiple figures
I am writing a Python tool that needs several figures open at the same time, each one with its own widgets (sliders, for the most part). I don't need any interactions across the figures here. Each ...
0
votes
0
answers
238
views
Problems with matplotlib blitted cursor embeded in PyQt6 gui
I´m currently developing a software to process spectroscopic data using python. I´m using PyQt6 to design the gui and matplotlib to plot the data. To simplify the data selection I added a cursor ...
1
vote
0
answers
114
views
Network graph In Matplotlib?
I had a question about python matplotlib I wanted to know in this library Is it possible to make grid diagrams in which circles are drawn and connected and intersected by lines? In the network graphs ...
0
votes
1
answer
164
views
Matplotlib pick_event not working with geopandas dataframe
Here is my Jupyer Notebook source code.
But a hard-coded reproducible example is below. (You will need access to the UK.geojson file from my Github or the true source: http://geoportal1-ons.opendata....
0
votes
1
answer
2k
views
FuncAnimation doesn't display animation
I have code that is running on a different machine.
%matplotlib widget
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np
n = 100
x = np.random.randn(n)
def ...
3
votes
1
answer
4k
views
Maplotlib figure not show in vscode jupyter notebook
The matplotlib figure suddenly doesn't display in vscode's jupyter notebook environment, even though I used:
%matplotlib inline
When I plot a figure, e.g.:
data = np.random.randn(1000, 2)
fig, ax = ...
1
vote
1
answer
134
views
Matplotlib changing underlying data for scatter plot with widget buttons
I have a plot in which I want to plot the following two data sets
x1,y1 = np.random.normal(0,1, (2,20)) # dataset 1
x2,y2 = np.random.normal(0,1, (2,20))
# Next, I create a plot and the ...
0
votes
1
answer
76
views
How to combine these two codes in Kivy?
I have two codes and I want to combine Python code into Kivy code.
python code:
import csv
import socket
import datetime
import time
from itertools import zip_longest
Time =[]
Price = []
fields = ['...
0
votes
1
answer
316
views
Kivy Matplotlib cannot be founded
I'm using kivy and matplotlib for visualization of data, these are the libraries:
`from kivy.uix.button import Button
from kivy.uix.spinner import Spinner
import pandas as pd
import matplotlib.pyplot ...
2
votes
0
answers
423
views
How to highlight the bar with a border when moving the mouse over it in the bar chart
I'm still a beginner and I'm trying to make the edge of the bar of the chart be highlighted (change color) in a mouse movement event when hovering over it. Only the bar over which the mouse hovers ...
0
votes
1
answer
144
views
Unclear figure plotting error in matplotlib 3D
I'm trying to better understand 3D plotting using various tutorials online. I tried to recreate one of these online tutorials, this one in particular by running some of the code in my own Jupyter ...
3
votes
0
answers
743
views
How do I make multiple span selectors work on the same axis in Matplotlib?
As the title suggests, I am trying to put multiple SpanSelector widgets on the same axis. In the test code below (adapted from this example), I am using a multi-plot figure with the qt backend, to ...
0
votes
1
answer
105
views
Plot graph in python where the width of each edge denotes the strength or frequency of cooccurrence
I have a dataframe of three classes (0, 1, and 2). After that, I calculate the cooccurrence of the class. Further, the diagonal element is assigned to 0. In conclusion, try to plot a cooccurrence ...
0
votes
1
answer
892
views
How to insert a slicer in a scatter plot that can be adjusted to filter calculations in the scatter plot
I have my data and codes for scatter plot as below:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# define X and y
np.random.seed(10)
x = np.arange(0,100)
y = np.random....
1
vote
0
answers
120
views
Visual Studio Code Jupyter Notebook matplotlib WIDGETS OUTPUT CELL background colour change [duplicate]
LTDR: I want the fourth image to look like the second image.
When using Visual Studio Code and Jupyter Notebook, if I use Matplotlib widgets, the colour of the output cell background is white.
This is ...
0
votes
1
answer
322
views
How to make pandas DataFrame plot's appear at the right point in a Jupyter notebook?
I have a Jupyter notebook with %matplotlib widget as the first line.
The notebook contains several markdown cells providing a header structure and some explaining texts.
Also there I am generating ...
0
votes
0
answers
243
views
Adding FigureCanvasBase object to Pyqt5 layout
I am working on a big dataframe where each row includes the values of various signals and all the rows should visualize based on their signals. Controlling this process on the single core takes a huge ...
0
votes
1
answer
6k
views
Matplotlib widgets don't work properly with IPython
I am using Matplotlib in a class to view 3-Dimensional physical data.
I have a fiew sliders and radiobuttons, in which I can update the view on the data (eg. which layer, or what scale to use).
This ...
1
vote
1
answer
404
views
is it possible to implement a matplotlib Slider into flask
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
import numpy as np
from PIL import Image
import requests
from io import BytesIO
img_src = 'https://unsplash.it/500/300'
response =...
0
votes
1
answer
1k
views
Python plot update on text input
I would like to create a plot with a function whose parameters can be updated by a text input on the figure in allocated textboxes. Let's say it would look something like the following:
Here you ...
1
vote
0
answers
249
views
Matplotlib button doesn't respond until moving cursor
I have som problems with buttons/animations in matplotlib. I'm trying to make an animation that starts when the button "start" is clicked on and stop when "stop" is clicked on. The ...
0
votes
1
answer
1k
views
Matplotlib not clearing old plots when updating figure
I have a code to plot points and to update the number of points in X,Y with a slider.
There is no way I can make the old plots disappear in the update function, tried all possible variations of .clear(...
0
votes
1
answer
528
views
How to reset/ start a new polygon with embeded matplotlib in pyqt
I am trying to create a polygon selector in my PySide2 application. Selector is working fine, but then I want to add functionality to reset/start new polygon when escape button is pressed. Something ...
1
vote
1
answer
295
views
Matplotlib backend notebook customizations
I'm using the matplotlib backend 'notebook', because I am making some interactive figures, and this works well with the notebook backend (in particular, I serve them via Jupyter Notebooks). I use ...
0
votes
1
answer
683
views
Use RectangleSelector after zooming in a matplotlib.pyplot figure?
I was wondering if there is a way to keep matplotlib's RectangleSelector activate after zooming. To hinder a possible confusion between my problem and existing ones, kindly note that
I am able to use ...
0
votes
0
answers
209
views
multiple plots with checkboxes
I'm currently using matplotlib.figure so that I can have two plots side by side, and then a table right below. One of the plots is a set of linear regressions, and the other is e^(linear regressions).
...