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

Matplotlib: mouse outside of slider axes continues to change plot

I have a simple script that plots data in x- and y-, and have two scrollbars. One scrollbar lets you scroll through the data in x. The second scrollbar lets you change the range of x values you see at a given time (SSCE below). It works almost…
eric
  • 7,142
  • 12
  • 72
  • 138
2
votes
0 answers

How to update an imshow inside a ipywidgets layout?

Problem I want to display a slider linked to a Play button from ipywidgets and then update an imshow plot from matplotlib. However I want the image to stay there and only draw the artists that changed and not have to clear the output to draw…
Bidon
  • 221
  • 1
  • 12
2
votes
2 answers

ipywidgets: How to get array input?

I need a widget that takes in an array as input, i.e. something like a hundred sliders (that I don't want to create manually). How can I achieve this? I thought the answer would be widgets.Box, but then I get the error Box(...) cannot be transformed…
2
votes
1 answer

Matplotlib RectangleSelector disappears when new image loaded in wxPython panel

I have an image in a wxPython panel that I want to edit by selecting with Matplotlib RectangleSelector. I have an Image_Viewer class that draws the image. I have an Editor class, where the RectangleSelector functionality resides. Editor inherits…
d8sconz
  • 279
  • 4
  • 14
2
votes
1 answer

How to determine which events are connected in Matplotlib?

Is there a function or method in Matplotlib that will tell you which events have been connected, and perhaps what code is being called by that listener? I've looked all over, no joy. I'm looking preferably for a generic solution, not one that is…
2
votes
1 answer

How to draw share xaxis subplot with multiple yaxis with Figure(matplotlib FigureCanvasQTAgg)?

I want to draw a graph that's share xaxis but different yaxis in vertical layer as image below. I have tried this import sys import matplotlib matplotlib.use("Qt5Agg") from PyQt5 import QtCore from PyQt5.QtWidgets import QApplication,…
2
votes
1 answer

my matplot's Grid is off by -0.5

I am trying to apply color-mapping to a 2d array using matplotlib library and python 3. For simplicity I made a example code to show my problem: Example Code: from matplotlib import pyplot as plt from matplotlib import colors import…
2
votes
1 answer

How to use matplotlib blitting to add matplot.patches to an matplotlib plot in wxPython?

I am making a plot using the matplotlib library and showing it in my wxPython GUI. I am plotting a massive amount of data points from a LIDAR instrument. The thing is, I would like to draw rectangles in this plot to indicate interesting areas. But…
2
votes
2 answers

Making multiple multi-line plots from one matrix

I'm wondering if there's a way to combine the apply function along with the matplot function to generate a new plot for every n columns in a matrix. I currently have a matrix with 1350 rows with 640 columns. I'm plotting the values for all the rows…
ipavli
  • 23
  • 2
2
votes
0 answers

Error plotting scrollable candlestick chart in Python

everyone I am new to stackoverflow! I am trying to plot an hourly OHLC candlestick chart using python and loading from a CSV file. My CSV file contains 10000 rows of data and I only want data within specific date range but the amount of date still…
Denzel
  • 358
  • 5
  • 19
2
votes
1 answer

How to force redraw of a widget after changing some of its attributes?

Inside the call-back associated with a matplotlib.widgets.Slider instance, I want to modify the Slider valmin, valmax and val attributes, and then re-draw the Slider. When I try to re-draw it, nothing happens. Before the call-back completes, I…
Fanta
  • 2,825
  • 5
  • 26
  • 35
2
votes
1 answer

How do I refresh MatPlotlib embedded in PYQT4?

I'm trying to make the PYQT embedded Matplotlib plot redraw when new data is selected. It draws the first plots perfectly. I've tried variations of many things that I've seen online to no avail. Any help is much appreciated. def mpl_plot(self,…
Mike C.
  • 1,761
  • 2
  • 22
  • 46
2
votes
1 answer

Matplotlib widget used on a plot produced by another matplotlib widget

I am trying to use matplotlib LassoSelector to select some points from a scatter plot and produce a separate figure for selected points only. When I try to use another matplotlib widget on the second plot it doesn't work but there is no error or…
janez
  • 21
  • 1
2
votes
1 answer

How to plot bar graph in python

I have below data in dictionary and want to plot bar with label('AT','BT','CT','DT','ET'). it is okay if only 3 digit after decimal considered. {0: 0, 1: 19.091883092036781, 2: 35.317606562921746, 3: 22.122563913375465, 4: 37.961028320110699, …
2
votes
2 answers

Linking a FuncAnimation() with a Button in Python 2.7

I am trying to start a graph (which is it's getting data from serial port) on a button's click. I had tried the following code but was not successful. I am new to python. Please help me in guiding were I am wrong. I am using Python 2.7 with…
Lalu
  • 41
  • 5
1 2
3
14 15