Questions tagged [matplotlib-widget]

matplotlib.widgets provide a simple mechanism for interactive, GUI style plots using matplotlib.

From the matplotlib.widgets page

GUI Neutral widgets

Widgets that are designed to work for any of the GUI backends. All of these widgets require you to predefine matplotlib.axes.Axes instance and pass that as the first argument. Matplotlib doesn’t try to be too smart with respect to layout – you will have to figure out how wide and tall you want your Axes object to be to accommodate your widget.

There are many useful examples including:

215 questions
1
vote
2 answers

Add a Matplotlib Graph to a Widget in KivyMD

I am currently creating a mobile app with KivyMD which serves for managing travel expense requests. The user will enter a desired requested amount for different types of expenses on an MDTextField. I want to add a donut graph made with patplotlib…
Diego Gc
  • 175
  • 2
  • 15
1
vote
2 answers

How to use slider.on_changed() within a class in Tkinter in Python

I'm trying to use a horizontal slider to change the xlim of my plot. But first, I can't figure out how to get the slider to update using the on_changed() method. I don't have a strong understanding of how classes, and objects interact with each…
krose
  • 390
  • 1
  • 6
  • 18
1
vote
1 answer

Matplotlib: How to plot points on my graph instead of painting them on a button?

Edit: ax.scatter(event.xdata, event.ydata) works fine, IDK how I went past this. However, pressing the button is still paint dots and I'm wondering if filtering coordinates is good practice to solve this. Here is my minimal code to plot some points…
1
vote
2 answers

Interactive matplotlib plot in PySimpleGUI

I'm trying to get the RectangleSelector form matplotlib.widgets to work with PySimpleGUI. I'm basing my test code on the RectangleSelector demo shown in the accepted answer on this question. I'm getting the plot to show in PySimpleGUI but it's not…
jonas87
  • 672
  • 2
  • 8
  • 22
1
vote
1 answer

How to set Matplotlib RadioButton radius using set_radius?

I try to set RadioButtons circle radius. According to the below MWE, the buttons disappeared. However, removing the circ.set_radius(10) recovers the buttons. Using circ.height and circ.width recovers buttons and if done properly they are perfectly…
Radek D
  • 79
  • 10
1
vote
1 answer

How to make class for onclick(event) functions for Interactive plot in matplotlib?

I have tried to create an interactive matplotlib plot using some functions. I want to group the functions into one class (I am still new to this, took help from someone else's code) import matplotlib.pyplot as plt def draw_line(startx,starty): …
1
vote
0 answers

Why matplotlib creates a new bar every time updating the image array

I want to display greyscale images with pyqt5 GUI and update the image display continuously, but the matplotlib creates a new colorbar every time updating the display. Below are the codes. from PyQt5.QtWidgets import* from…
billinair
  • 93
  • 1
  • 11
1
vote
1 answer

Can I use buttons from one screen to make changes to other screen?

I have a skeleton of an app I want to make. I'm trying to understand how a button from the "values screen" can interfere with the plot in the "direction screen". Is it even possible ? I couldn't figure out the syntax of such an "update" function…
1
vote
1 answer

matplotlib.widgets.Slider with histogram

I'm trying to make the interactive histogram but during update old histogram is not been cleared, as shown in the image below. ) above plot is generated using following code from functools import lru_cache import scipy.stats as ss import…
rho
  • 771
  • 9
  • 24
1
vote
1 answer

matplotlib.widgets.Slider with fill_between

I'm trying to Add the slider in the plot similar to the slider demo example. I'm plotting fill_between which gives PolyCollection object. Although I tried with plot too which give Line2D object as shown picture below, but plot doesn't update as…
rho
  • 771
  • 9
  • 24
1
vote
0 answers

Wait for user interaction with a widget in the frontend (INLINE JUPYTERNOTEBOOK)

I'm trying to create a simple GUI that works embedded in a jupyter notebook. The idea is to create a slider widget that updates a plot. Once a user finds the preferred slider position, then he just clicks a button widget, and the program saves the…
1
vote
1 answer

Fix size of the Canvas who contains a Scrollable FigureCanvasTkAgg

I want to ask you if anyone can fix ScrollableTkAggX, The problem is that the tk.Canvas() or tk.Tk() in the grid position always need to set the gridrowconfigure and columnconfigure, to make the widget expand and resize, in the normal condition we…
NajmiAchraf
  • 21
  • 2
  • 5
1
vote
1 answer

Slider not working and updating values in graph

the following code is not updating the graph as i change the slider. The slider consists of two variables Ao and Au which i wanted to change. Initially Ao is set to be 600 and Au is set to be 800. as the slider moves i expected the graph to change…
Zewo
  • 153
  • 1
  • 12
1
vote
0 answers

Removing of white space in Tkinter widget with .tex expression embedded

I'm creating an application that generates mathematical expressions, displays them and allows to check whether student simplified it correctly. I have tried sympy.preview as an approach but it was not satisfactory due to latex installation required.…
mathfux
  • 5,759
  • 1
  • 14
  • 34
1
vote
0 answers

Creating a matplotlib spectrogram with frequency 'marker' and 'pause' button

I am creating a simple spectrogram in matplotlib I am wondering how (or where to start, in order to learn) to create a simple cursor tracker that tells me the frequency value at peaks of my graph. The spectrogram I am trying to reproduce is below.…
Chris
  • 11
  • 3