As the name suggests, the gui module contains a collection of modules that make up the AvoPlot GUI.
This module is still under construction! Eventually, it will contain a set of data analysis tools for working with data.
Bases: wx._misc.ArtProvider
Customised art provider class for serving the AvoPlot specific icons.
Overrides CreateBitmap from wx.ArtProvider. This method looks in the AvoPlot icons directory (as returned by avoplot.get_avoplot_icons_dir()) for the icon specified by artid. The icons are split up into subfolders by size (for example “16x16”) and this method will only look in the relevant size subfolder for the requested icon.
Bases: wx.lib.agw.aui.auibook.AuiNotebook
Notebook control which holds all the controls for the currently selected element. Each set of controls (as returned by element.get_control_panels()) is added as a new tab in the notebook.
Event handler for element add events. Passes the event through to all pages currently in the control panel
Event handler for element delete events. Removes any control panels associated with the deleted element from the notebook.
If the element is not the currently selected element, then the event gets passed through to all pages currently in the control panel
Event handler for element select events. Adds any relevant control panels for the newly selected element to the notebook.
Event handler for page changed events. Calls the on_control_panel_active() method on the control panel that has been newly selected.
Event handler for page changing events. Calls the on_control_panel_inactive() method on the control panel that is being de-selected.
Sets the control panels shown in the notebook. ‘control_panels’ should be a list of AvoPlotControlPanelBase objects.
Bases: wx._windows.Dialog
Base class for all Dialogs used in the GUI.
Bases: avoplot.gui.dialog.AvoPlotDialog
Event handler for close events. Destroys the dialog box.
Bases: wx._windows.Panel
Event handler for line colour change events.
Event handler for line style change events.
Event handler for line thickness change events.
If val==True then disables the line properties controls, else enables them.
Bases: tuple
LineType(name, mpl_symbol, has_width)
itemgetter(item, ...) –> itemgetter object
Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
itemgetter(item, ...) –> itemgetter object
Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
itemgetter(item, ...) –> itemgetter object
Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
Bases: wx._windows.Panel
Event handler for marker style change events.
Event handler for marker fill colour change events
Event handler for line thickness change events.
Event handler for marker fill colour change events
Event handler for marker size change events
Shows or hides marker property controls depending on which are relevant for the currently selected marker type. current_marker should be a MarkerType named tuple.
Bases: tuple
MarkerType(bitmap, mpl_symbol, has_size, has_fill, has_edge)
itemgetter(item, ...) –> itemgetter object
Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
itemgetter(item, ...) –> itemgetter object
Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
itemgetter(item, ...) –> itemgetter object
Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
itemgetter(item, ...) –> itemgetter object
Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
itemgetter(item, ...) –> itemgetter object
Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
The main module contains the code for the main frame of the AvoPlot GUI.
Bases: wx._core.App
wx app for the AvoPlot program. Overrides the OnInit method to do some startup tasks.
Bases: wx._windows.Frame
Main frame of the GUI. This is set as the top level window when the AvoPlot App is created in the AvoPlot.py script.
Adds a figure element (an avoplot.figure.AvoPlotFigureBase instance) to the current session.
Create all the GUI elements and show the main window. Note that this needs to be separate from the __init__ method, since we need set the top level window for wx before calling launch().
All AvoPlot events (see the ‘core’ module) are posted to the MainFrame where they are handled by this method. All it does is to repost the event to all the GUI components so that they can react as needed.
Handler called when the MainFrame is closed. This performs all the tidy up operations such as saving program state. Note that all elements that can be reached through the AvoPlotSession - i.e. all those that have a parent that isn’t None, will have their delete() method called before the program exits.
Event handler for pane close events (where the panes are those managed by the AUI manager of the MainFrame object - currently just the control pane and the navigation pane).
Event handler for the “unhiding” of the control pane.
Event handler for the “unhiding” of the navigation pane.
Displays a warning message in a wx.MessageBox. This is designed to override the warnings module’s show_warning function.
Bases: wx.lib.agw.aui.auibook.AuiNotebook
AuiNotebook for displaying figures in. Multiple figures may be viewed simultaneously by splitting the notebook.
Event handler for AvoPlotElementDelete events. If the element is a figure then the notebook page associated with the figure is deleted - note that this destroys the window, and so future attempts to access the figure object will cause an exception.
Event handler for AvoPlotElementAdd events. Adds a page to the notebook for newly created figure objects.
Event handler for AvoPlotElementRename events. If the element is a figure then the relevant notebook page is renamed accordingly.
Event handler for AvoPlotElementSelect events. Changes the currently selected notebook page to that containing the newly selected element.
If the selected element is not a figure, then the figure which contains the element is selected.
Event handler for tab change events. Calls on set_selected() on the figure associated with the newly selected tab.
Event handler for tab close events. This vetos the event to prevent the notebook from destroying the window and then calls delete() on the figure object associated with the tab that has just been closed, relying on the event handlers for the AvoPlotElementDelete event to actually destroy the window when it is finished with (this is done by on_delete_element() in this class)
Event handler for right click events on the notebook tabs. Creates a popup menu allowing the user to close the tab, split the tab and rename the tab.
Event handler for rename events (from the tab right click menu) for notebook pages. Opens a rename dialog and then sets the name of the relevant figure object. Note that this generates an AvoPlotElementRename event and the actual renaming of the notebook tab is left up to the event handler for this event - on_rename_element()
Splits the selected pane horizontally.
Splits the selected pane vertically.
Unsplits all the panes.
The text module contains classes and functions for editing matplotlib Text objects
Restores the whole background region from the cache and then draws the animated text objects over the top. You should call this every time you change the text and want the changes to be drawn to the screen.
Start the animation of the text. This must be called before you call redraw_text. This creates a cache of the figure background and registers a callback to update the cache if the background gets changed.
Deletes the background cache and removes the update callback. Should be called whenever you are finished animating the text
Bases: wx._windows.Panel
Panel to hold the text property editing controls within the TextPropertiesEditor dialog. The Text object to be edited should be passed to the constructor.
Note that this panel does not use blitting methods to get fast text animation because that causes layout problems for certain text objects - e.g. the layout of axis labels and tick-labels are related to each other, and this is not honoured properly if blitting methods are used.
Returns the currently selected font colour (as a HTML string).
Returns the name of the currently selected font.
Returns the currently selected font size (integer number of points)
Returns the stretch of the font currently selected
Returns the style (‘normal’, ‘italic’ etc.) of the font currently selected
Returns the weight of the font currently selected
Event handler for font colour change events.
Event handler for font selection events.
Event handler for font size change events.
Event handler for font stretch (e.g. compressed) change events.
Event handler for font style (e.g. italic) change events.
Event handler for font weight (e.g. bold) change events.
Redraws the text - does not use blitting for fast animation because that causes layout problems in some cases.
Bases: avoplot.gui.dialog.AvoPlotDialog
Dialog which allows the user to edit the text properties (colour, font etc.) of a set of matplotlib.text.Text object. The Text objects to be edited should be passed to the dialog constructor - which will accept either a single Text object or an iterable of Text objects
Applies the selected properties to text_obj which must be a matplotlib.text.Text object
Event handler for Apply button clicks
Event handler for frame close events
Event handler for Ok button clicks.
Bases: wx._controls.ToolBar
Main program toolbar
Enables the plot tools if state=True or disables them if state=False
Event handler for new element events. If the element is not a figure then nothing gets done. For figures, their zoom and pan settings are updated depending on the toggle state of the zoom/pan tools.
This method also enables the plot navigation tools if they were previously disabled.
Event handler for element delete events.If the element is not a figure then nothing gets done. If the element being deleted was the last figure in the session, then this disables the plot navigation tools.
Event handler for element select events. Just keeps track of what the curretly selected element is.
Event handler for “home zoom level” events. Resets all subplots in the current figure to their default zoom levels.
Handle ‘new’ button pressed. Creates a popup menu over the tool button containing the same entries as the File->New menu.
Event handler for pan tool toggle events. Enables or disables panning in all figures accordingly.
Event handler for save tool events. Opens a file save dialog for saving the currently selected figure as an image file.
Event handler for zoom tool toggle events. Enables or disables zooming in all figures accordingly.
Enables (state = True) or disables (state = False) the pan tool for all figures. The zoom tool will be disabled if needed.
Enables (state = True) or disables (state = False) the zoom tool for all figures. The pan tool will be disabled if needed.
The widgets module contains a set of convenience widgets for building control panels for elements.
Bases: wx.combo.OwnerDrawnComboBox
Bases: avoplot.gui.widgets.SettingBase
A text label next to a wx choice control.
Bases: avoplot.gui.widgets.SettingBase
A text label next to a wx colour picker control.
Bases: wx._core.BoxSizer
Event handler for checkbox events. This should be overridden in the subclass.
Event handler for clicks on the hyperlink. This should be overridden in the subclass.
Sets the checkbox to be either checked (value = True), or unchecked (value = False).
Bases: wx._core.BoxSizer
Base class for settings controls.
Bases: avoplot.gui.widgets.SettingBase, avoplot.gui.text.AnimatedText
A text label next to a wx text entry control. The matplotlib Text object associated with the control is automatically animated to provide fast redraws when the text is changed.
A font properties button is displayed next to the text control (if the text entry box is not empty) which opens a font properties dialog.
Event handler for when the control gets focus. Starts the text animation (i.e. caches the background).
Event handler for text change events. Updates the text on the figure and redraws it.
Event handler for clicks on the “font properties” button. Opens a font properties dialog.
Event handler for when the control loses focus. Stops the text animation