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

Plotting matplotlib figure inside QWidget using Qt Designer form and PyQt5

I don't understand the best way to link a matplotlib figure to a form created from Qt Designer. I have a form I created in QtDesigner and then compiled to python through pyuic5. My main program is: import app_framework as af import matplotlib from…
launchpadmcquack
  • 1,021
  • 1
  • 12
  • 19
11
votes
3 answers

RectangleSelector Disappears on Zoom

When I run this example and create a rectangular selection if I zoom or move the plot window around the selection disappears until I deselect the move or zoom tool and click on the plot window again. I am using %matplotlib tkinter in an IPython…
alessandro
  • 363
  • 1
  • 12
7
votes
0 answers

How to resize matplotlib figure to match ipywidgets.Output() size automatically?

I am building a webapp with interactive plots based on Jupyter and Voila. Inside the notebook I use ipywidgets for handling the interactivity and %matplotlib widget backend so I can update my plots without redrawing the whole figure (does not work…
Paloha
  • 558
  • 6
  • 14
6
votes
2 answers

Displaying Radio buttons horizontally in matplotlib

I am using the matplotlib.widgets to create radio buttons in my widgets, the buttons coming are stacked vertically, I would like them to be stacked horizontally. MVCE: import matplotlib.pyplot as plt from matplotlib.widgets import…
anand_v.singh
  • 2,768
  • 1
  • 16
  • 35
6
votes
2 answers

How to make relim() and autoscale() in a scatter plot

The next code plots three subplots. from ipywidgets import widgets from IPython.display import display import matplotlib.pyplot as plt import numpy as np %matplotlib notebook fig, (ax1, ax2,ax3) = plt.subplots(nrows=3, figsize=(10,9)) line1, =…
user1993416
  • 698
  • 1
  • 9
  • 28
6
votes
2 answers

How do I adjust the size and aspect ratio of matplotlib radio buttons?

I've been trying for hours to get the size and aspect ratio of a simple list of radio buttons correct with no success. Initially, import the modules: import matplotlib.pyplot as plt from matplotlib.widgets import RadioButtons Then the actual radio…
evianpring
  • 3,316
  • 1
  • 25
  • 54
5
votes
2 answers

Embedding "Figure Type" Seaborn Plot in PyQt (pyqtgraph)

I am using a wrapper of PyQt (pyqtgraph) to build a GUI application. I wish to embed a Seaborn plot within it using the MatplotlibWidget. However, my problem is that the Seaborn wrapper method such as FacetGrid do not accept an external figure…
Hanan Shteingart
  • 8,480
  • 10
  • 53
  • 66
4
votes
0 answers

matplotlib widgets not working in Jupyterlab 2.1.2

I am running Jupyterlab 2.1.2 on Ubuntu 19.10, since my upgrade to Jupyter lab 2.x the matplotlib widget is not working. Every time I try to create a figure: %matplotlib widget import numpy as np from matplotlib import pyplot as plt fig, ax =…
Renato
  • 41
  • 5
4
votes
1 answer

How to use the Span Selector on a embedded figure of matplotlib widget?

I am working on GUI where I have a system with graphs. I want to use the spanselector in the graph i do visualize. I have searched and i can't understand how to use the span selector while calling the matplotlib widget. This is an example i'm…
4
votes
1 answer

The python program is not ending when tkinter window is closed

I am working on a project to make Oscilloscope like GUI. Although GUI is not ready yet but I got a problem that the program is not being closed when I am closing the TKinter window. It is still running in python shell. I thought this might be the…
4
votes
1 answer

Pyinstaller onefile Executable Incredibly Huge and Slow

I know I'm not the first to ask, but the other answers on the forum could not help me, so I'm asking. I have a short (181 line) python script that only has the imports import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import…
Haji Giray
  • 43
  • 1
  • 8
4
votes
1 answer

Why does my pie chart in Tkinter does not show?

I am building an application which takes input, saves it to a CSV file and now the last basic part is to display a pie chart of the content of the column. The input is supposed to be about books. So, the pie chart should for example display the…
Alex_P
  • 2,580
  • 3
  • 22
  • 37
4
votes
1 answer

updating colorbar without resetting zoom history in matplotlib user interface

I am trying to make a plot in which the color scale is updated on zoom on the base of the visualized data, using a scheme similar to e.g. http://matplotlib.org/examples/event_handling/viewlims.html (also note similar question Matplotlib imshow,…
Vincenzooo
  • 2,013
  • 1
  • 19
  • 33
3
votes
0 answers

Export JupyterLab 3.* with %matplotlib widgets to html

I'm running into an issue with exporting my notebooks from Jupyter Lab. I work with 3D figures and want to export the entire notebook as HTML with images in the current state. I was able to do so in Jupyter Notebook with the %matplotlib notebook…
Lucvv
  • 116
  • 7
3
votes
1 answer

How to make Matplotlib widget faster?

I am using Matplotlib widget slider on a figure having many plots. When I move the slider it takes about 5 s to update the figure and that is my problem. After troubleshooting the problem, it seems that the culprit is the widget itself that calls…
Gz0r
  • 41
  • 1
  • 6
1
2 3
14 15