rayoptics.qtgui.plotview module
Support for fully featured QT windows for plotting/matplotlib
- class PlotCanvas(parent, figure, accept_drops=True, drop_action=None)[source]
Bases:
FigureCanvasQTAgg
- staticMetaObject = PySide6.QtCore.QMetaObject("PlotCanvas" inherits "FigureCanvasQTAgg": )
- create_plot_view(app, figure, title, view_width, view_ht, commands=None, add_panel_fcts=None, add_nav_toolbar=False, drop_action=None, context_menu=None)[source]
create a window hosting a (mpl) figure
- create_2d_figure_toolbar(app, pc)[source]
zoom, fit and pan commands for figures Pan Zoom Box Fit Zoom In, Out 1:1
Create a (Qt) context menu for a (mpl) figure.
Args:
app: the Qt main app
pc: the Qt-specific backend for mpl, CanvasFigure
menu_actions: list of potential context menu actions
each menu action is a tuple consisting of:
action_desc:str the menu item text
action_handle:str the key in the actions dict for the action
action: the action class to be instantiated if picked
The fig.selected_shape is what the actions are built against. The action should raise a TypeError if an incompatible shape is supplied.