Plot Functions

Based on the example provided by matplotlib 1.3.1 documentation.

See also: misc example code: multiprocess.py

Adapted to work without GTK and support multiple subplots and axis overlay.

Using the Plotter to plot graphics

Usage of Python utility classes to help plotting charts.

class py4syn.utils.plotter.Plotter(title, daemon=True, priority=0)[source]

Python class to represent an almost real-time plotter. This Plotter spawn another process responsible for the data plot and graph update. Priority should be between 0 (default) and 19 (maximum allowed).

Constructor

Parameters:
title : string

Title of the plot

daemon : bool

This parameters indicates if the spawned process should be daemon or not In general if daemon is set to True as the script ends it will close the graph, otherwise the script will end only when the graph is closed

clear(axis=1)[source]

Clear the graph.

Parameters:
axis : int

The axis index to be cleaned.

createAxis(title='', label='', xlabel='', ylabel='', grid=True, line_style='-', line_marker='o', line_color='red', parent=None)[source]

Creates a subplot in the plotter, also it’s possible to create an axis to a parent subplot through the parent parameter

Parameters:
title : string

Title of the plot

label : string

Label for the Axis Legend, if blank or None will not appear in the legend

xlabel : string

Label for the X axis

ylabel : string

Label for the Y axis

grid : bool

If True, will render grid to the graph area.

lineStyle : string

The line style according to Matplotlib Line2D style list

lineMarker : string

The line marker according to Matplotlib Markers list

lineColor : string

The line color, accepts any matplotlib color

parent : int

Index of the parent subplot

plot(x, y, axis=1)[source]

Plot data to graph.

Parameters:
x : double

X data

y : double

Y data

axis : int

The axis index where data should be plot.

updateLabel(axis=1, label='')[source]

Update the label in a given axis.

Parameters:
axis : int

The axis index to be cleaned.

label: `string`

The new label.

updateTitle(axis=1, title='')[source]

Update the label in a given axis.

Parameters:
axis : int

The axis index to be cleaned.

title: `string`

The new title.