matplotlib-widget

plt.ion() is preventing MultiCursor from working

无人久伴 提交于 2021-02-11 15:17:49
问题 My full code can generate multiple Matplolib plots in multiple windows. This is how I want it as sometimes I want to see them on 2 screens and see a variety of outputs at the same time. Each window has several 'sharey' subplots and I want to share the cursor, using MultiCursor in the Vertical axis. I am using plt.ion() so that the multiple windows are non-blocking, i.e. they all open at the same time rather than one opening when the previse is closed. When I run the code, plt.ion() seems to

plt.ion() is preventing MultiCursor from working

柔情痞子 提交于 2021-02-11 15:16:10
问题 My full code can generate multiple Matplolib plots in multiple windows. This is how I want it as sometimes I want to see them on 2 screens and see a variety of outputs at the same time. Each window has several 'sharey' subplots and I want to share the cursor, using MultiCursor in the Vertical axis. I am using plt.ion() so that the multiple windows are non-blocking, i.e. they all open at the same time rather than one opening when the previse is closed. When I run the code, plt.ion() seems to

Add a Matplotlib Graph to a Widget in KivyMD

风流意气都作罢 提交于 2021-01-29 15:45:09
问题 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 want to add a donut graph made with patplotlib into an MDBoxLayout. Such graph should automatically update as the request is filled. (For clarity I will include a screenshot. The square in red is the desired location for my graph). I created a method called update_method_graph and used fixed

Displaying Radio buttons horizontally in matplotlib

。_饼干妹妹 提交于 2019-12-24 01:14:58
问题 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 RadioButtons plt.subplots_adjust(left=0.2) rax = plt.axes([0.5,0.05,0.1,0.1]) radio = RadioButtons(rax ,['1','2','3'], active=0, activecolor='blue' ) plt.show() As you can see with this example you can get the radio buttons like this , I am wondering is there a way

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

雨燕双飞 提交于 2019-12-20 01:49:28
问题 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, = ax1.semilogx([],[], label='Multipath') hline1 = ax1.axhline(y = 0, linewidth=1.2, color='black',ls='--') text1 = ax1.text(0, 0, "T Threshold", verticalalignment='top', horizontalalignment='left', transform=ax1.get_yaxis_transform(), color='brown',

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

浪子不回头ぞ 提交于 2019-12-11 10:02:46
问题 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 when I draw a rectangle on the same axes as the plot, the whole plot gets replotted which takes lots of time. This is because of the self.canvas.draw(), a function which replots everything. The code gets displayed as follows in the GUI: Printscreen

How do I get narrow width and a large height on a RadioButtons widget, and still have round radio buttons that don't overlap?

荒凉一梦 提交于 2019-12-10 19:58:43
问题 How do I get narrow width and a large height on a RadioButtons widget, and still have round radio buttons that don't overlap? plt.figure() rax = plt.axes([0.1, 0.1, 0.6, 0.6], frameon=True ,aspect='equal') labels = [str(i) for i in range(10)] radios = RadioButtons(rax, labels) for circle in radios.circles: # adjust radius here. The default is 0.05 circle.set_radius(0.02) plt.show() The above works because it sets width and height of the axes instance to 0.6, but I want width to be, say, 0.1

selection file in a panel and visualize in another panel wxpython

佐手、 提交于 2019-12-10 12:16:14
问题 it's a little complicated but I will try I have a panel or a button 'file' for the choice of a file and the opening of this file is a .nc file (netCDF4) so I would like to visualize it but the problem I would like to see it in one other panel which will be like a quicklook, and each time you have to choose a file of type .nc or directly to be visualized on the other panel and here is part of my code for 2 panels: class LeftPanelTop(wx.Panel): # panel choose file def __init__(self, parent):

RectangleSelector Disappears on Zoom

爱⌒轻易说出口 提交于 2019-12-04 18:39:15
问题 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 notebook. I've attempted hooking into the limit changes that occur when the window is zoomed and setting the rectangular selection to visible: def persist_rect(newlims): rs = toggle_selector.RS print(rs.visible) rs.set_visible(True) rs.update() current

RectangleSelector Disappears on Zoom

怎甘沉沦 提交于 2019-12-03 12:45:37
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 notebook. I've attempted hooking into the limit changes that occur when the window is zoomed and setting the rectangular selection to visible: def persist_rect(newlims): rs = toggle_selector.RS print(rs.visible) rs.set_visible(True) rs.update() current_ax.callbacks.connect('xlim_changed', persist_rect) current_ax.callbacks.connect('ylim_changed',