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

jupyter notebook: update plot interactively - function has constants and keyword arguments

I want to have an interactive plot in jupyter (4.0.6) notebook using matplotlib (1.5.1). The thing is that the static plot is created with a function that has four variables, two of them are constants, two of them are keyword arguments, and I want…
Claus
  • 4,409
  • 4
  • 19
  • 16
1
vote
0 answers

Matplotlib pick events across multiple figures

I am writing a program where I have multiple figures that are plotting data from multiple sources in different forms (e.g. x vs. y, x/y vs. x, etc.). I am trying to introduce some element of interaction where the user can select certain points on…
Ben D.
  • 31
  • 5
1
vote
0 answers

How to use IPython Notebook Widget interact() with a heavy computation matplotlib plot?

How to prevent computation of function inside interact while clicking the mouse and only get the result after releasing it? The problem is I have a plot that takes around 10s to compute and it depends on a real valued parameter. I want the slider to…
gota
  • 2,338
  • 4
  • 25
  • 45
1
vote
1 answer

Python Using pyplot slider with subplots

I am quite new to Python, so please excuse if this is a stupid beginner's error. However I am struggling with it for quite some time. I want to create a figure with n x m subplots, each subplot being np.array of shape [1024,264,264]. As I am looking…
Tilman
  • 13
  • 1
  • 4
0
votes
0 answers

pyqt matplotlib widget not redrawing with imshow call

I'm trying to create a PyQt5 matplotlib widget which shows processed/annotated images as they are processed. The main project is a larger pyqt GUI for computer vision which has a separate thread for the image processing and emits signals containing…
Magnus
  • 1
0
votes
0 answers

I want to make a PolygonSelector from matplotlib to embed in tkinter frame. When i did that, the canvas freeze

enter image description here from matplotlib.widgets import AxesWidget import matplotlib.pyplot as plt import tkinter as tk from matplotlib.widgets import PolygonSelector from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg # from…
0
votes
0 answers

matplotlib multiple dependent sliders

i have two sliders setup, one to control the position on the plot and one to control the scale of the x-axis. this works great, except i am using a different dataframe to control the slider than what the x-axis actually is, as it is in excel…
ewm
  • 1
0
votes
0 answers

Event loop already running error with widgets

Please help with the solution to the problem: QCoreApplication::exec: The event loop is already running. I need to create a window with a button. When you click on the button, a new window opens with the image and the clicker module, which allows…
0
votes
1 answer

Using a Slider from matplotlib.widgets doesn't work

So i want to change a graph in real time using a slider. I tried learning it this bottom code is from youtube where it worked. When i run it though, all this does is shows a picture of a graph with a slider, that i cant change. I am using spyder IDE…
0
votes
0 answers

How to remove auto scaling in matplotlib 3D plot

There is small doubt, when I try to extend the following graph to some bigger value of x lets say x=1000 keeping all other parameter same. The graph gets shrunk in x direction but I want it to get extended along x without auto scaling so that i can…
0
votes
0 answers

Combine matplotlib slider and funcanimation

I have an animation working well with FuncAnimation. My goal is to change a parameter with a slider and update the animation instantly. I don't know how to combine both. You'll find my code down here, I call additionary function from an another file…
0
votes
0 answers

Funcanimation(Matplotlib - Python) - Plots leaving a trail when moving from the right end to the left

I am trying to plot the ground track of a satellite. The plot is leaving a trail when it is moving from the right end to the left(The yellow line in between). How to get rid of that in such manner that after the right end, the plot starts from the…
0
votes
0 answers

Customise the icons of the toolbar created using NavigationToolbar2Tk

I want to customise the icons (like home, back, forward, pan etc) on the matplotlib toolbar. In this case I am writing a GUI with tkinter with embedded pyplot plot in the widget of the GUI and create the toolbar with NavigationToolbar2Tk. After…
0
votes
0 answers

Making plot with subfigure created elsewhere (matplotlib)

I have a function "makeGrid(tensor)" that takes as an argument a pytorch tensor of shape (B,3,H,W), and uses ImageGrid to make a figure that displays the batch of figures in a grid. Now, the model that outputs "tensor", depends on one parameter,…
Frotaur
  • 113
  • 8
0
votes
0 answers

MatPlotLib: I generated a 3D plot from point data. How can I add bar graphs on each respective face?

This is an example of my MatPlotLib 3D surface plot, which I generate with point data using this function: def fill_between_3d(ax, x1, y1, z1, x2, y2, z2, mode=1, c='gray', alpha=1): for i in range(len(x1) - 1): verts = [(x1[i],…