Registers a callable to be executed when the event loop is empty. The callable will only be called once. This is used to execute the _destroy() method of AvoPlotElementBase.
Returns the full path to the directory where the AvoPlot icons are stored.
Returns the path used by AvoPlot for things like caching settings, storing templates etc. This is platform dependent, but on Linux it will be in ~/.AvoPlot
Returns the path used by AvoPlot to store user independent files
Returns the full path to the COPYING file installed with AvoPlot
Bases: wx._windows.ScrolledWindow
Base class for control panels - these are the tabs shown in the “Control Panel” frame.
Adds a new element into the control panel’s sizer - *args and **kwargs are the same as for a wx.BoxSizer.
Returns the name of this control panel - this will be the text displayed in the tab heading.
Returns True if the setup() method has already been run for this control panel, False otherwise.
This method will be called automatically each time the control panel becomes the active control panel (i.e. the user selects it, it has focus). This can be overridden by subclasses to perform needed actions on control panel activation (e.g. enabling tools etc.)
This method will be called automatically each time the control panel stops being the active control panel (i.e. the user selects a different one). This can be overridden by subclasses to perform needed actions on control panel de-activation (e.g. disabling tools etc.)
This method will be called each time the control panel is displayed i.e. every time that the element that the control panel operates on is selected. It can be overridden by subclasses in order to perform processing before it is displayed (for example updating lists of available data series etc.)
Control panels are typically instanciated before their parent frame is known. Therefore, the majority of the setup of the panel should be done in the setup method - this is passed the parent window as its only argument. Subclasses that override this method should be sure to call the setup method of their parent class before doing anything else.
The core module provides the base class for AvoPlot elements, which are used to represent the hierarchy of plots - i.e. a figure may contain many subplots, a subplot may contain many data series etc.
The element framework is designed to cope with the fact that many different components of the GUI may modify plot elements and all of these components will need to be notified of the changes. For example, a figure may be renamed by using the right-click menu on the its tab in the plots panel. It can also be renamed using the navigation panel - both of these panels need to be notified when the name of a figure gets changed. The way this is implemented is as follows: the panel doing the renaming calls figure.rename_element(). This changes the name of the element and generates an AvoPlotElementRenameEvent. Both the plots panel and the navigation panel handle this event and use it to update their appearance. Adding and deleting elements works in a similar way.
Bases: object
Base class for all AvoPlot elements. Elements are essentially a container class that holds child elements. For example, a figure element can contain several subplots as its children.
Adds a control to the element. This must be an instance of a subclass of avoplot.controls.AvoPlotControlPanelBase.
Sets the element’s parent to None, and calls the delete() method of any child elements. Generates a AvoPlotElementDeleteEvent event.
Returns the element’s unique id number (integer)
Returns a list of child elements (instances of AvoPlotElementBase or its subclasses).
Returns a list of control panel objects (instances of avoplot.controls.AvoPlotControlPanelBase) that relate to the element.
Note that the control_panel objects returned may not be initialised yet.
Returns the elements name.
Returns the parent element of this element (this will be an instance of AvoPlotElementBase or one of its subclasses)
Sets the name of the element. If the parent element already contains a child element with the specified name, then ‘(n)’ will be appended to the name assigned (where n is an integer counter). This will generate an AvoPlotElementRenameEvent.
Reparents the element to the element specified. parent must be an instance of AvoPlotElementBase or one of its subclasses, or None.
If the new parent already has a child of the same name, then the element’s name will be updated using set_name().
Generates an AvoPlotElementSelectEvent for the element.
Redraws the element in the display. This should be called after the element is changed to reflect the changes in the display. This must be overridden in subclasses.
Bases: avoplot.core.AvoPlotElementBase
A session is the “root” element for an AvoPlot program instance. It doesn’t really do anything by itself, but provides a parent to any figures that get created.
Returns a unique ID number. This is used to identify different elements across a single instance of the AvoPlot program.
Bases: wx._windows.Panel
Returns a numpy array which is a mask where 0 == data not selected and 1 == data selected. The length of the mask will be equal to that of the series.
Callback handler for the “select all” button.
Callback handler for the “horizontal select” button.
Callback handler for the “rectangular select” button.
Callback handler for the “vertical select” button.
Bases: avoplot.data_selection.SelectionToolBase
Tool for selecting the entire series.
Bases: avoplot.data_selection.SpanSelector, avoplot.data_selection.SelectionToolBase
Bases: avoplot.data_selection.SpanSelector, avoplot.data_selection.SelectionToolBase
This must be implemented by the subclass - disables the selection tool and clears any current selection.
Clear the current selection
Disables the selection tool - disconnecting the matplotlib canvas callbacks and clearing any current selection.
Returns a mask array where 1 == selected data point and 0 == not selected data point.
Returns True if event should be ignored, false otherwise
Callback handler for mouse click events in the axis. Creates a new selection rectangle.
Callback handler for draw events. Re-caches the background for future blitting and redraws the selection rectangles.
Event handler for mouse move events.
Event handler for mouse click release events.
Redraws the selection rectangles.
Re-caches the backgound.
Bases: avoplot.data_selection.SpanSelector, avoplot.data_selection.SelectionToolBase
Returns a colour (as an RGB tuple) that will be visible against the background of the subplot.
Bases: avoplot.core.AvoPlotElementBase, wx._windows.ScrolledWindow
The AvoPlotFigure class represents a single plot tab in the plotting window. The parent argument should be the main (top-level) window.
If val == True, then enables the pan and zoom tools for the figure (in fact for all open figures). If val == False, then disables them.
Creates the canvas for the figure to be drawn into. This is done here rather than in __init__ so that we have the option of vetoing the displaying of the figure if something goes wrong during its construction, e.g. if the file cannot be loaded etc.
Returns the matplotlib figure object associated with this figure.
Returns all subplots within the figure to their default zoom level.
Returns True if the pan tool is selected, False otherwise.
Returns True if the zoom tool is selected, False otherwise.
Event handler for mouse click events in the figure canvas.
Toggles the pan/zoom functionality for the figure.
Opens a file save dialog for exporting the figure to an image file - all matplotlib output formats are supported.
Associates a status bar with this figure.
Not yet implemented! positions = {name1:(row, col),name2:(row,col)}
Redraws the entire figure.
Toggles the zoom functionality for the figure.
Bases: avoplot.controls.AvoPlotControlPanelBase
Control panel for figure elements allowing the user to change the background colour, title etc. of the figure.
The figure argument must be an instance of AvoPlotFigure (or a subclass).
Event handler for background colour selections.
Event handler for figure title changes.
Creates all the figure editing controls.
Bases: exceptions.Exception
Exception raised when the fitting fails for some reason
Bases: avoplot.fitting.FittingToolBase
Fits a gaussian to some data using a least squares fit method. Returns a named tuple of best fit parameters (amplitude, mean, sigma, y_offset).
Initial guess values for the fit parameters can be specified as kwargs. Otherwise they are estimated from the data.
If plot_fit=True then the fit curve is plotted over the top of the raw data and displayed.
Bases: tuple
GaussianParameters(amplitude, mean, sigma, y_offset)
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])
Returns a reference to the global persistant storage class. Which can be used for storing settings across program restarts.
Bases: exceptions.IOError
Bases: avoplot.core.AvoPlotElementBase
Base class for all data series.
Adds a series as a child of this series. Normally you would expect series to be parented by subplots, however, for things like fit-lines it makes more sense for them to be associated with the series that they are fitting then the subplot that they are plotted in.
series must be an instance of avoplot.series.DataSeriesBase or subclass thereof.
Overrides the base class method in order to remove the line(s) from the axes and draw the changes.
Returns the AvoPlot figure (avoplot.figure.AvoPlotFigure) object that the series is contained within, or None if the series does not yet belong to a figure.
Returns a list of matplotlib line objects associated with the data series.
Returns the AvoPlot subplot (subclass of avoplot.subplots.AvoPlotSubplotBase) object that the series is contained within, or None if the series does not yet belong to a subplot.
Returns True if the series has already been plotted. False otherwise.
Plots the data series into the specified subplot (AvoPlotSubplotBase instance) and returns the list of matplotlib lines associated with the series. This method should be overridden by subclasses.
Runs any preprocessing required on the data and returns it. This should be overridden by subclasses.
Redraws the series.
Bases: avoplot.series.XYDataSeries
Bases: avoplot.controls.AvoPlotControlPanelBase
Control panel where the buttons to draw backgrounds will appear
Bases: tuple
GaussianParameters(amplitude, mean, sigma, y_offset)
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])
Bases: avoplot.series.DataSeriesBase
Class to represent 2D XY data series.
Exports the selected data series. Called when user right clicks on the data series (see nav_panel.py).
Returns a tuple (xdata, ydata) of the data held by the series, with any pre-processing operations applied to it.
Returns a tuple (xdata, ydata) of the raw data held by the series (without any pre-processing operations performed). In general you should use the get_data() method instead.
Static method that returns the class of subplot that the data series can be plotted into. This will be a subclass of AvoPlotSubplotBase.
plots the x,y data into the subplot as a line plot.
Runs any required preprocessing operations on the x and y data and returns them.
Sets the x and y values of the data series. Note that you need to call the update() method to draw the changes to the screen. Note that xdata and ydata may be masked arrays (numpy.ma.masked_array) but only the unmasked values will be stored.
Bases: avoplot.controls.AvoPlotControlPanelBase
Control panel to allow user editing of data series (line styles, colours etc.)
Creates all the controls in the panel
Bases: avoplot.controls.AvoPlotControlPanelBase
This gets called automatically when the control panel is selected.
This gets called automatically when the control panel is un-selected.
Creates all the controls in the panel
Fits a gaussian to some data using a least squares fit method. Returns a named tuple of best fit parameters (amplitude, mean, sigma, y_offset).
Initial guess values for the fit parameters can be specified as kwargs. Otherwise they are estimated from the data.
If plot_fit=True then the fit curve is plotted over the top of the raw data and displayed.
Bases: avoplot.core.AvoPlotElementBase
The AvoPlotSubplotBase class is the base class for all subplots - which represent a set of axes in the figure.
Adds a data series to the subplot. data should be an instance of avoplot.series.DataSeriesBase or a subclass.
Returns the AvoPlotFigure instance that this subplot is contained within , or None if the series does not yet belong to a figure. Use get_figure().get_mpl_figure() to get the matplotlib figureobject that the subplot is associated with.
This method should be overridden by subclasses wishing to customise the look of the subplot before it is displayed.
Event handler for mouse click events. These will be passed to the subplot from its parent figure. This should be overriden by subclasses.
Overrides the AvoPlotElementBase class’s method. Does the exactly the same as the base class but ensures that the parent is an AvoPlotFigure instance.
Bases: avoplot.subplots.AvoPlotSubplotBase
Subplot for containing 2D (XY) data series.
Adds (i.e. plots) a data series into the subplot. data should be an avoplot.series.XYDataSeries instance or subclass thereof.
Overrides base class delete method in order to remove the axes from the figure and draw the changes.
Returns the matplotlib axes object associated with this subplot.
Event handler for mouse click events.
Called by on_mouse_button() if the event was a right-click. Creates a PopupMenu for adding new data series to the subplot.
Redraws the subplot.
Bases: avoplot.gui.widgets.EditableCheckBox
Event handler for the gridlines checkbox.
Bases: type
Metaclass which ensures that a class’s my_init() method gets called once, after it’s __init__ method has returned.
Bases: avoplot.gui.widgets.EditableCheckBox
Bases: avoplot.controls.AvoPlotControlPanelBase
Control panel for allowing the user to edit subplot parameters (title, axis labels etc.). The subplot argument should be an AvoPlotXYSubplot instance.
Event handler for the background colour selector.
On Windows, parts of the control panel do not draw correctly unless you send a size event - so we do that here.
This is called automatically when the control panel is displayed (see baseclass docstring).
Creates all the controls for the panel.