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

How to set the updated value of Slider always in the centre?

Following the Slider Demo of Matplotlib https://matplotlib.org/gallery/widgets/slider_demo.html, I would like to update the Slider ranges, so that every time I change the slider values, those are re-centred in the Slider. I have tried to define the…
dani reta
  • 69
  • 8
0
votes
1 answer

Kivy ScreenManager with Matlibplot to Graph live Data

I am new to Python (using 3.4.2) and Kivy (v1.11.0 dev0) and I am trying to make an app with two screens. In one screen the user can set pump settings and in the next screen the user can see a live graph of pressure that is recorded from pressure…
Snorkels
  • 1
  • 2
0
votes
1 answer

Use Matplotlib Plot and Widgets in function and return user input

My problem is the following: I create a Matplotlib figure including some widget sliders and a button to close the figure. This works. What can I do to use this code inside a function which returns e.g. the values of the slides AFTER clicking the…
gruenkohl
  • 103
  • 1
  • 8
0
votes
0 answers

Two RectangularSelectors at the same time - weird "solitaire pattern"

I am trying to add two rectangular selectors (docs) to my plots: Currently, I create the Area and Background classes (both containing the rectangular selectors) upon pressing a keyboard key. Upon pressing another key I create two more classes that…
Sebastiano1991
  • 867
  • 1
  • 10
  • 26
0
votes
0 answers

Is it possible make matplotlib slider for graphs axis?

I explored and didn't find if its possible make slider to horizontal axis (specifically time axis for my case) with Matplotlib library. I mean something in style in this page: plotly slider
user3205436
  • 57
  • 1
  • 8
0
votes
1 answer

Matplotlib Button draw line

I want to create something that can show (and hide with the same button) a line. Here's what I have for the moment : import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Button fig, ax = plt.subplots() class…
SagemOg
  • 5
  • 5
0
votes
1 answer

matplotlib with TkAgg backend doesn't work on Mac High Sierra

I have a code for GUI(wxPython) that plots data and that works fine on Windows 7 machine: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32 matplotlib.get_backend() returns TkAgg as the…
0
votes
1 answer

Plot figure object in a specific figure

I have an object from a black box of type: I would like to plot it in a matplotlibwidget, in my pyqt5 GUI. The problem is: How to plot my object in a specific figure? I tried this: myObject =…
Alex42
  • 21
  • 1
  • 3
0
votes
0 answers

How to reduce idle time when using Matplotlib interactive buttons

I suspect I am using the interactive features of matplotlibsomehow in the wrong way, because I have to wait several seconds between one plot and the next when using the following code and structures. My data base is a pandas DataFrame of around…
Michele Ancis
  • 1,265
  • 4
  • 16
  • 29
0
votes
0 answers

How to tell interaction window which y value to display with twin axes?

I'm working on a Python script to display the results of musical pitch analysis. I have twinned the first axis and supplied a custom ticker so I can view the results in both Hz and Pitch. The relevant code, based on the example at…
0
votes
1 answer

Python stacked bar chart not being displayed like Excel chart

I am trying to create a stacked bar chart in Python to try and match the stacked bar chart produced by Excel but I can't seem to get it to match the output of Excel. The Python chart is not showing me values in the A array.excel chart python…
DJS
  • 1
  • 1
0
votes
1 answer

How do I add a matplotlib.widget.Button to my wxpython plotting canvas?

I have been trying to add a matplotlib.widget.Button to my matplotlib plotting canvas, which is integrated in wxPython, but without succes. This is the code that generates the canvas: from matplotlib.figure import Figure from…
0
votes
1 answer

Pass arguments to slider update?

UPDATE: I learned the basics of matplotlib so now I realize my previous question was out of place, but now I've run into a new problem. Let's say I have a slider that is updated with def update_execution(val): executionStep =…
Meme Overlord
  • 997
  • 1
  • 9
  • 16
0
votes
1 answer

Annotation object handling in matplotlib

I am trying to implement a plot with interactive sliders in Matplotlib. I used the suggestions from Interactive matplotlib plot with two sliders to implement the sliders. Now I am trying to move an annotation of a point when the sliders change.…
Wolpertinger
  • 1,169
  • 2
  • 13
  • 30
0
votes
0 answers

How do I remove the margins around the mplwidget's canvas?

I am not sure why the canvas inside mplwidget has some margin on all sides even when the layout margins have been set to 0. In Qt Designer: Runtime: The same issue can be seen in this sample chapter of the Matplotlib for Python Developers ebook…
FatHippo
  • 177
  • 3
  • 12