The basicpanel module

A resuable panel for displaying graphs.

This module provides a panel which can be used in frames to display graphs to the user. It uses matplotlib, and it probably is not the fastest (as in processing speed) way to implement this, but it works for the most part.

Classes

GraphPanel

class src.gui.graphing.basicpanel.GraphPanel(parent, labels, title=None, dataQueue=None)[source]

A simple panel for displaying a single, multi-plot graph.

This is a simple panel for displaying graphical data to the user. It interacts with the relevant Experiment and Graph objects through a Queue instance.

Parameters :

parent : wxWindow

The window (frame or panel) which contains this panel.

labels : 2-tuple of str

A two-string sequence of strings representing the x- and y-axis labels for the graph.

title : str

If not None, the title that goes above the graph.

dataQueue : Queue

An instance of Queue.Queue used to transfer data between a Graph object and this panel.

Methods

addPlot()[source]

Add a new plot to the current graph.

addPoint(data)[source]

Add a new point to the graph.

Parameters :

data : 6-tuple of float

A tuple which consists of the following values (all floats) in order:

  • the x-value of the point to add,
  • the y-value of the point to add,
  • the minimum x-value in the graph,
  • the maximum x-value in the graph,
  • the minimum y-value in the graph, and
  • the maximum y-value in the graph.
drawPlot(event=None)[source]

Redraw the plot.

onExit(event)[source]

Destroy the panel.

onUpdate(event)[source]

Update the plot.

Query the queue, popping points from it, until it is empty. Then draw the graph with the new data.

setDataQueue(dataQueue)[source]

Set the data queue.

toggleUpdates(event=None)[source]

Enable updates to the graph.

Table Of Contents

Previous topic

The graphing package

Next topic

The basicframe module

This Page