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
0
votes
1 answer

After I convert my script to executable file, it gives this error : MatplotlibDeprecationWarning

I have an error which's complete form is MatplotlibDeprecationWarning: The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and will be removed in 3.3 I converted my script into executable file. After conversion, it never opened.…
0
votes
0 answers

Struggling to get widgets working in python

I don't know why but I am really struggling to get widgets working well in python. I try to look at examples about how to use them but I don't know how to extrapolate that to get it to work with my code. I am trying to get a figure to display…
Harry Spratt
  • 179
  • 11
0
votes
2 answers

matplotlib FuncAnimation won't start on button press widget event

matplotlib noob here. I am trying to create an animation (which starts on a button click) of a normal distribution being populated, where the distribution parameters (mean and std dev) are selected using two slider widgets. Please help. I have…
0
votes
2 answers

Matplotlib MultiCursor is not displaying on multiple subplots

I have a Matplotlib plot with 6 adjacent, vertical plots, all with sharey=True. When I move the cursor on any one plot, I want a horizontal cursor/marker to show on the other 5. I understand MultiCursor is the best method. I have looked at this and…
WillH
  • 281
  • 2
  • 13
0
votes
2 answers

Why isn't FuncAnimation repeating when I'm put repeat = True as a parameter?

import matplotlib.image as mpimg import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.widgets import Button from matplotlib.widgets import Slider fig = plt.figure() image_list = …
0
votes
0 answers

Is it possible to have 1 matplotlib slider control 2 different matplotlib animations?

If anyone has any experience doing this, please let me know as I would greatly appreciate it.
0
votes
0 answers

Matplotlib figure and axis background color

I want to remove(red and blue) or set as transparent the color of axis and figure (such as below image). How could I do this? like set_facecolor('transparent') is not working here is my code: self.fig = Figure(figsize=(8, 7.5), dpi=55) …
phzdjz
  • 79
  • 7
0
votes
0 answers

Plot blocking issue for interactive plot using matplotlib.widgets

I'm writing a code which plots raw data from an experiment and I'm trying to manipulate a regression in that plot using matplotlib.widget with the Slider widget. The widget changes a fitting parameter of the regression and automatically…
0
votes
1 answer

matplotlib scatter animation in jupyterlab vanishes after initial frame

I'm have a JupyterLab notebook (v1.1.4) in which I'm trying to animate a scatter plot. I tried using the raindrops example from the matplotlib examples, and it runs fine, but I can't get mine to work. Here's a MWE %matplotlib widget import…
0
votes
0 answers

Why I cannot use matplotlib and tkinter in a class

I am having problems using matplotlib and tkinter at the same time. I am trying to create a matplot graphic with radio buttons and embed it in tkinter Following some examples and documentation over the Internet, I have created the following…
0
votes
1 answer

Configuring live graph axis with Tkinter and Matplotlib

I am currently trying to create a live graph on a window using Tkinter and Matplotlib. The data from this graph is continuously appended onto a CSV file and saved like this example row: 06/09/2020 19:57:53,4,2.549,3.546 Where the second column is…
0
votes
1 answer

Bargraph condition color option in matplotlib

How can I modify the below code to colour age group 0-20 as orange and 60 above as red and Rest as yellow? Below is the code: Import matplotlib. pyplot as plt dataset. Plot(Kind='bar', x='Patient_Age_Grp',y='Claim_amount', color='red')…
ScriptLearner
  • 163
  • 3
  • 16
0
votes
1 answer

Frame containing a scrollable canvas is not taking up the rest of the allotted Tk window

I have written an application that allows users to select a directory and load the info in the directory. The user can then select which aspects of the files to display in a figure. The figure is placed in a Tkinter-matplotlib canvas which is within…
Nana Owusu
  • 96
  • 7
0
votes
1 answer

Making SpanSelector wait for a specific keypress event

I have a script which spawns a data plot with a SpanSelector widget. The widget calls a select_window(vmin, vmax) closure function, which uses the window limits to analyse the chosen data. The analysis function spawns another plot with some visual…
adigitoleo
  • 92
  • 1
  • 8
0
votes
1 answer

using non-global variables inside onselect function of SpanSelector object

I am trying to slice and save data (pandas.DataFrame with more than one column) based on features visible in a plot into seperate files each time I select a slice. So far I used the matplotlib SpanSelector with it's onselect function. However, this…
Vorgon
  • 104
  • 1
  • 4