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
0 answers

how to make checkbox works fine in notebook, tkinter, matplotlib

I have 3 sheets in a notebook that do the same thing as I show in the code below. (This code works fine here but not in my code) All sheets have the function checkbox_O and g_checkbox with the same name and all use the global variable lines When I…
0
votes
1 answer

Plot graph in python where the width of each edge denotes the strength or frequency of cooccurrence

I have a dataframe of three classes (0, 1, and 2). After that, I calculate the cooccurrence of the class. Further, the diagonal element is assigned to 0. In conclusion, try to plot a cooccurrence graph with the width of each edge which denotes the…
Pranab
  • 379
  • 3
  • 11
0
votes
1 answer

How to insert a slicer in a scatter plot that can be adjusted to filter calculations in the scatter plot

I have my data and codes for scatter plot as below: import numpy as np import pandas as pd import matplotlib.pyplot as plt # define X and y np.random.seed(10) x = np.arange(0,100) y = np.random.randint(0,100,100) df = pd.DataFrame(dict(x=x,…
ukanafun
  • 181
  • 5
0
votes
0 answers

How to center the ticklabel in the middle of two major ticks?

I have trying to center the ticklabes in the axis using ax[].set_xticks([], minor=True) and ax1.set_xticklabels(, minor=True), but I got to hide the minor ticks, Anyone knows how to center without remove the minor ticks? or other way to center…
0
votes
1 answer

How to make pandas DataFrame plot's appear at the right point in a Jupyter notebook?

I have a Jupyter notebook with %matplotlib widget as the first line. The notebook contains several markdown cells providing a header structure and some explaining texts. Also there I am generating some plots from pandas.DataFrames, which are grouped…
Torsten Knodt
  • 477
  • 1
  • 5
  • 20
0
votes
0 answers

Adding FigureCanvasBase object to Pyqt5 layout

I am working on a big dataframe where each row includes the values of various signals and all the rows should visualize based on their signals. Controlling this process on the single core takes a huge amount of time. Therefore I wanted to split the…
0
votes
1 answer

Matplotlib widgets don't work properly with IPython

I am using Matplotlib in a class to view 3-Dimensional physical data. I have a fiew sliders and radiobuttons, in which I can update the view on the data (eg. which layer, or what scale to use). This works perfectly fine in Pycharm when running a…
Jonathanthesailor
  • 159
  • 1
  • 1
  • 8
0
votes
1 answer

is it possible to implement a matplotlib Slider into flask

import matplotlib.pyplot as plt from matplotlib.widgets import Slider import numpy as np from PIL import Image import requests from io import BytesIO img_src = 'https://unsplash.it/500/300' response = requests.get(img_src) img =…
Krits
  • 53
  • 1
  • 7
0
votes
1 answer

Python plot update on text input

I would like to create a plot with a function whose parameters can be updated by a text input on the figure in allocated textboxes. Let's say it would look something like the following: Here you input your values for a, b, c, and d and then press…
0
votes
1 answer

Matplotlib not clearing old plots when updating figure

I have a code to plot points and to update the number of points in X,Y with a slider. There is no way I can make the old plots disappear in the update function, tried all possible variations of .clear() and so on... Here is my code; comments are…
nls
  • 11
  • 2
0
votes
1 answer

How to reset/ start a new polygon with embeded matplotlib in pyqt

I am trying to create a polygon selector in my PySide2 application. Selector is working fine, but then I want to add functionality to reset/start new polygon when escape button is pressed. Something similar to this PolygonSelector example, when…
Simon
  • 65
  • 1
  • 9
0
votes
1 answer

Use RectangleSelector after zooming in a matplotlib.pyplot figure?

I was wondering if there is a way to keep matplotlib's RectangleSelector activate after zooming. To hinder a possible confusion between my problem and existing ones, kindly note that I am able to use the RectangleSelector at original view…
Bedir Yilmaz
  • 3,823
  • 5
  • 34
  • 54
0
votes
0 answers

multiple plots with checkboxes

I'm currently using matplotlib.figure so that I can have two plots side by side, and then a table right below. One of the plots is a set of linear regressions, and the other is e^(linear regressions). I would like to use matplotlib widgets…
Daniel
  • 33
  • 4
0
votes
1 answer

Slider is unresponsive when figure contains two plots

Python 3.9, matplotlib 3.4, Mac OS 11.6.1 I have a slider on a tkinter Toplevel containing a figure convas showing two sets of axes. As the slider advances, the axes illustrate the heatplots over time for two sequences of 4-by-300 matrices. Each…
fishbacp
  • 1,123
  • 3
  • 14
  • 29
0
votes
1 answer

How to pass additional arguments when updating a matplotlib widget

I have multiple similar Sliders, and want to call the function update with a certain argument when a the corresponding slider is changed. Passing additional parameters should work similarly to other widgets, e.g., on_clicked() of Button. Simplified…
P1ker
  • 53
  • 1
  • 5