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

Put a slider right under a subplot in matplotlib

I'm trying to put a slider right under the x-axis of a subplot in matplotlib, so that both start and end at the same value. Is there an easy way to do that, meaning that I don't have to find the right coordinates and put them myself when I create…
Antys
  • 49
  • 1
  • 6
1
vote
1 answer

Make matplotlib button widget actuate when pressed, not when released

I made a simple interactive matplotlib figure that uses buttons to browse plots. A minimal example of one such button is: import matplotlib.pyplot as plt from matplotlib.widgets import Button def message(_): print('Hello, World!') buttonAxes =…
gsa
  • 43
  • 3
1
vote
1 answer

Not able to draw a bounding box with "Width" attribute on the matplotlib's plot?

I am trying to draw a bounding box across text such as : from matplotlib.pyplot import text from matplotlib.patches import FancyBboxPatch import matplotlib.transforms as mtransforms import numpy as np import matplotlib.pyplot as plt def…
Anu
  • 3,198
  • 5
  • 28
  • 49
1
vote
0 answers

adding wedge to basemap in matplotlib

I have a Data frame of 4 columns(point names, latitude, longitude and angles). I am plotting all the points in basemap w.r.t lat & long values. I have written a function to calculate distance for a given point to all the points in the dataframe and…
amrutha
  • 193
  • 1
  • 11
1
vote
0 answers

How to remove a matplotlib collection

The Python program below plots a random set of 3 points and circles around them according to the eps slider value. When changing the slider value, the circles change. Also, if two circles touch each other, a segment connecting their centers is …
Sigur
  • 355
  • 8
  • 19
1
vote
1 answer

Creating a figure with plots, sliders and other widgets arranged with a gridspec layout

I want to create an animated graph which parameters can be controlled with sliders and other widgets. I have to create several similar figures so I want to pack this in some class to be reused with various parameters. But before that, I wanted to…
Karlovsky120
  • 6,212
  • 8
  • 41
  • 94
1
vote
1 answer

Set logical status of CheckBox in matplotlib without triggering callbacks?

Is there a way to set the logical status of CheckButtons in matplotlib withput triggering onclick() callbacks? Here is my scenario: I am displaying a graph with a large number of traces (50+) and want to give the user the option of displaying a…
GroovyGeek
  • 63
  • 6
1
vote
1 answer

How can I (in Python) remove a matplotlib Artist from a plot by using blitting?

Can I remove a matplotlib artist such as a patch by using blitting? """Some background code:""" from matplotlib.figure import Figure from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas self.figure =…
1
vote
0 answers

Rectangular Selector does not save previously selected values

I am trying to make the basic rectangular selection (matplotlib) in python, but with results being appended instead of being updated. Right now, if I draw a rectangle, it selects the points in the area, but that's it. If I select a rectangle…
1
vote
1 answer

Basemap / PySide QWidget: Drawing text onto map

I'm having difficulty writing text onto a Basemap that is inside a PySide QWidget. From what I've found online, people do the following: import matplotlib.pyplot as plt ... plt.text(x, y, 'some text') But when I try something like that with my…
1
vote
1 answer

Matplotlib interactive widget from python script

I am adapting this example to interact with a plot using matplotlib's widgets. The way I normally work is interactive, from within spyder I just call a function that does the plotting. My goal is to make an executable available to users who do not…
Michele Ancis
  • 1,265
  • 4
  • 16
  • 29
1
vote
1 answer

No module named basemap

Following the instructions in this page,I downloaded the basemap and its dependencies. When I run sudo apt-get install python-mpltoolkits.basemap It gives me the following output: Reading package lists... Done Building dependency tree …
1
vote
1 answer

How to clear a plot with a pushButton in PyQt?

I have created a little GUI in PyQt using QT Designer. I have one button."Clear" button must clear this plot(My clear button calls pushButton). I try to write some code but it don't run. How can I create this clear button? Thank you. import…
srky
  • 350
  • 2
  • 4
  • 12
1
vote
2 answers

Matplot lib image properties in web (Django)

I'd like to output the image to the web created in matplotlib having the very same functionality like it has on desktop when you run the image.show(), for example scaling, moving along the plot more thoroughly. I've checked out #stack and got old…
Aleks_Saint
  • 67
  • 1
  • 2
  • 12
1
vote
0 answers

How to handle costum created button clicked events in python matplotlib?

I have a sequence of images that I am trying to display them using a figure/plot in matplotlib. Also I want to allow the users to navigate between images by clicking on next and previous buttons that I have created using matplotlib.widgets. Here is…
user2308191
  • 281
  • 1
  • 7
  • 18