Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
Filter by
Sorted by
Tagged with
2 votes
1 answer
2k views

The slider behavior in matplotlib has changed with recent updates. With the following code: import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Slider fig = plt.figure(...
Mr. T's user avatar
  • 12.5k
1 vote
1 answer
1k views

I would like to call a function by pressing a matplotlib-button. Right now, following approach works: Run script Press start-button in diagram window => cond=True execute function in console by ...
gerban's user avatar
  • 11
2 votes
1 answer
1k views

So, I'd like to set the 2 y data of a fillbetween object, equivalent to setting the (1) y data of a Line2D with some_line.set_ydata(new_y). A naïve attempt results in this error: AttributeError: '...
Andre's user avatar
  • 798
2 votes
1 answer
2k views

The following is a simplified example of my code. The idea behind this class is to show the figure only when the show method is executed. # my_module.py import matplotlib.pyplot as plt import numpy as ...
Davide_sd's user avatar
  • 13.8k
0 votes
1 answer
166 views

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 ...
fishbacp's user avatar
  • 1,263
0 votes
1 answer
1k views

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 ...
P1ker's user avatar
  • 53
0 votes
1 answer
62 views

Hi and thanks for reading. What I am trying to do is to make a web app that would take an image, run it through the model and return a segmented version. I can not use imshow in the webapp though. So ...
Menhior's user avatar
  • 41
0 votes
1 answer
375 views

I have a code that uses matplotlib and the Button widget. It all works well, but when this code is written as a function, the buttons stop working. This is because after the function runs, the button ...
OnY's user avatar
  • 897
0 votes
0 answers
1k views

I want to create a JSON file to use for training my machine learning model to create boundary boxes and it appears to be out of date. This is the error I am getting: The 'drawtype' parameter of ...
Blake Mischley's user avatar
1 vote
1 answer
368 views

import matplotlib.pyplot plt.figure() plt.plot(x, 'r+', label='one') plt.plot(x1, 'go--', label ='two') plt.plot(y, 'ro', label='Three') plt.legend() In the above code legend marker is 'r+' , 'go--'...
daspran's user avatar
  • 11
0 votes
0 answers
233 views

I need to create interactive chart, on which a line can be slided right/left on x axis while saving new values. Illustration: I have the right red line in the A position but want to move it to B ...
Ксения Козлова's user avatar
3 votes
0 answers
792 views

I'm trying to dynamically update a figure created using FacetGrid. I made a custom plotting function (plot_heatmap_w_scatter), in which I want to add a correction factor to the scatter function inside....
quirkygroundhog's user avatar
0 votes
1 answer
736 views

I pulled the below code from SO and modified it to get closer to what I need. Basically, I want the user to move a slider to change the position of the axhline, which then will be used to do come ...
higrm's user avatar
  • 25
0 votes
0 answers
305 views

I am trying to build some kind of a game where you have to keep the cursor as close as possible to a line. For this I animated a piecewise function with animation.FuncAnimation and added a crosshair ...
Toan's user avatar
  • 1
0 votes
1 answer
174 views

def doAnchoreGraph(image): print(image) info = infoAnchoreLog(image) window = Toplevel() window.title('Report '+ image) window.geometry("1000x1000") data = {'CVE': ['...
noobmir's user avatar
2 votes
0 answers
208 views

I am building a GUI with matplotlib, and have two sliders which are used to set time values in unix/epoch time. However, this format isn't human-readable, and I would like it to be displayed in [%Y-%m-...
robotics dude's user avatar
0 votes
2 answers
65 views

I'm trying to use ginput to register clicks on a map, and wanted to add action buttons using matplotlib widgets. In the following code, I can pass back the value of action to the main code by ...
ClimateUnboxed's user avatar
0 votes
0 answers
226 views

I have the following code. The Button widget is not responding to hover event. What am I doing wrong? from matplotlib import pyplot as plot from matplotlib.widgets import Button plot.plot([1,2,3], [1,...
Dinesh's user avatar
  • 1,886
0 votes
2 answers
165 views

I have the following code. The grid is visible without the Button widget. But when the grid is not shown if I add the button. What am I doing wrong? from matplotlib import pyplot as plot from ...
Dinesh's user avatar
  • 1,886
2 votes
0 answers
300 views

Basically, I want to plot images using matplotlib such that I want to control them actively. I have looked at this link, but it does not seem to quite answer the question. I have written a program ...
CoolCoder's user avatar
  • 832
3 votes
2 answers
4k views

I'm trying once more to use interactive matplotlib plots in Jupyter Notebooks for my students. My plan is to use JupyterLab as the plain Notebook interface is not very well liked among students. Here ...
Chipmuenk's user avatar
  • 697
1 vote
0 answers
262 views

I can zoom when i use a 2d plot using the area selection tool with the mouse on the plot, but when i want to do the same on a 3d plot, the 3d plot is rotated. Is this not possible in 3d mode or do i ...
Joysn's user avatar
  • 1,029
0 votes
1 answer
362 views

I am using a matplotlib.widgets slider and it's working perfectly but there is a little red line that marks the initial value of the slider that I would like to remove. I checked the documentation for ...
Turbulent Flow's user avatar
3 votes
0 answers
331 views

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 ...
Lucvv's user avatar
  • 116
0 votes
1 answer
667 views

I am using the following functions in order... - plt.figure() - plt.plot() - plt.ylim - plt.xticks() - figure = plt.gcf() - figure.set_size_inches() - plt.savefig() I just want to save the ...
Jonah Dafilou's user avatar
0 votes
0 answers
99 views

I wanted the sizes of radion button axes proportional to the number of radio buttons options (30, 20 and 10 in my example), like on my "without 'equal'" screenshot and round radiobutton ...
Yulia V's user avatar
  • 3,567
1 vote
1 answer
1k views

Is it possible to change RectangleSelector properties after it has been created? Let's say I created a figure with the following rectangle: from matplotlib.widgets import RectangleSelector import ...
Tommaso's user avatar
  • 89
3 votes
1 answer
2k views

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 ...
Gz0r's user avatar
  • 41
1 vote
2 answers
4k views

I am currently creating a mobile app with KivyMD which serves for managing travel expense requests. The user will enter a desired requested amount for different types of expenses on an MDTextField. I ...
Diego Gc's user avatar
  • 185
3 votes
2 answers
660 views

I want to update subplots based on a SpanSelector which works as expected. But another requirement is that I need to initialize the selected span to some given values. I have tried to call the _press, ...
KIC's user avatar
  • 6,069
2 votes
2 answers
2k views

Consider the excel file as given: I want to plot an interactive line plot using the Normalize_Nifty Values for a particular date based on a particular symbol. For this I am using the ipywidgets. I ...
Huzefa Sadikot's user avatar
2 votes
1 answer
385 views

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 ...
eric's user avatar
  • 8,285
1 vote
2 answers
2k views

I'm trying to use a horizontal slider to change the xlim of my plot. But first, I can't figure out how to get the slider to update using the on_changed() method. I don't have a strong understanding of ...
krose's user avatar
  • 410
0 votes
1 answer
28 views

I am trying to putdown the strign value from the text field to the string in the mplwidget suptitle but it is not working. te = (self.a1.text()) self.MplWidget.canvas.figure.suptitle("Thermo ...
Naga Sairam's user avatar
1 vote
1 answer
506 views

Edit: ax.scatter(event.xdata, event.ydata) works fine, IDK how I went past this. However, pressing the button is still paint dots and I'm wondering if filtering coordinates is good practice to solve ...
Roman Tsaruk's user avatar
0 votes
1 answer
518 views

I have a plot in which the x axis contains datetime.datetime objects. I am trying to change the range of the x axis with multiple matplotlib.widgets.Buttons. One button shows all datetimes, while ...
Erdrick's user avatar
  • 97
0 votes
1 answer
251 views

I have an error which's complete form is MatplotlibDeprecationWarning: The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and will be removed in 3.3 I converted my script into ...
Arda Ünal's user avatar
0 votes
0 answers
135 views

I don't know why but I am really struggling to get widgets working well in python. I try to look at examples about how to use them but I don't know how to extrapolate that to get it to work with my ...
Harry Spratt's user avatar
1 vote
2 answers
11k views

I'm trying to get the RectangleSelector form matplotlib.widgets to work with PySimpleGUI. I'm basing my test code on the RectangleSelector demo shown in the accepted answer on this question. I'm ...
jonas87's user avatar
  • 684
2 votes
0 answers
3k views

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 ...
Bidon's user avatar
  • 221
1 vote
1 answer
363 views

I try to set RadioButtons circle radius. According to the below MWE, the buttons disappeared. However, removing the circ.set_radius(10) recovers the buttons. Using circ.height and circ.width recovers ...
Radek D's user avatar
  • 103
1 vote
1 answer
1k views

I have tried to create an interactive matplotlib plot using some functions. I want to group the functions into one class (I am still new to this, took help from someone else's code) import matplotlib....
Shyam Bahmani's user avatar
1 vote
0 answers
244 views

I want to display greyscale images with pyqt5 GUI and update the image display continuously, but the matplotlib creates a new colorbar every time updating the display. Below are the codes. from PyQt5....
billinair's user avatar
0 votes
2 answers
727 views

matplotlib noob here. I am trying to create an animation (which starts on a button click) of a normal distribution being populated, where the distribution parameters (mean and std dev) are selected ...
HarshaV's user avatar
0 votes
3 answers
748 views

I have a Matplotlib plot with 6 adjacent, vertical plots, all with sharey=True. When I move the cursor on any one plot, I want a horizontal cursor/marker to show on the other 5. I understand ...
WillH's user avatar
  • 303
0 votes
2 answers
925 views

import matplotlib.image as mpimg import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.widgets import Button from matplotlib.widgets import Slider ...
mjasian's user avatar
  • 11
0 votes
0 answers
36 views

If anyone has any experience doing this, please let me know as I would greatly appreciate it.
mjasian's user avatar
  • 11
0 votes
0 answers
613 views

I want to remove(red and blue) or set as transparent the color of axis and figure (such as below image). How could I do this? like set_facecolor('transparent') is not working here is my code: self....
phzdjz's user avatar
  • 99
0 votes
0 answers
293 views

I'm writing a code which plots raw data from an experiment and I'm trying to manipulate a regression in that plot using matplotlib.widget with the Slider widget. The widget changes a fitting parameter ...
Patamoose's user avatar
0 votes
1 answer
169 views

I'm have a JupyterLab notebook (v1.1.4) in which I'm trying to animate a scatter plot. I tried using the raindrops example from the matplotlib examples, and it runs fine, but I can't get mine to work. ...
scmartin's user avatar