Module azcam.functions.plot

azcam.plot contains plotting support for azcam.

When working in IPython, use pylab.ion() for interactions after this import.

Global variables

var plotdata

plot data - azcam.functions.plot.plotdata

var style_dot

list of markers with dots - azcam.functions.plot.style_dot

var style_lines

list of line styles - azcam.functions.plot.style_lines

var style_o

list of markers with circles - azcam.functions.plot.style_o

var style_x

list of markers with crosses - azcam.functions.plot.style_x

Functions

def clear_data() ‑> None

Clears plot data from tools().

def close_figure(figures: str = 'all') ‑> None

Close plot figure and their windows.

Args

figures
list a string of figure numbers to close.
def delay(delay: float) ‑> None

Delay for delay seconds keeping GUI event loop working.

Args

delay
delay in seconds.
def display(azimage: object, cmap: str = 'gray') ‑> None

Make a matplotlib display of an azcam image. cmap is a matplotlib color map.

Args

azmage
azcam image.
cmap
color map name.
def get_data() ‑> dict

Returns plot data from tools(). Initial data is {'KeyPressed':'','MouseButton':-1,'X':-1.0,'Y':-1.0}

def line(figure_number=1) ‑> None

Interactive: Plot a line on a plot figure. print() allowed here as interactive only.

Args

figure_number
figure number.
def move_window(figure_number=1, x=None, y=None) ‑> None

Moves a figure to position x,y in screen pixels.

Args

figure_number
figure number.
x
Use None for auto.
y
Use None for auto.
def plot_image(azimage: object, scale_type: str = 'sdev', scale_factor: float = 20.0, cmap: str = 'gray') ‑> None

Plot an Azcam image buffer nicely.

Args

scale_type
one of (sdev, minmax, scaled, absolute).
scale_factor
scaling factor for 8-bit conversion.
cmap
color map name.
def rescale(axes_values: list = None, sub_plot: int = 111, figure_number: int = 1) ‑> None

Replot a figure with new axes limits. During prompt, hit return to leave as is.

Args

axes_values
list of new axis values as [xmin,xmax,ymin,ymax].
sub_plot
subplot ID, as NumRows+NumCols+Number (111, 221, etc).
figure_number
figure number.
def save_figure(figure_number: int = 1, figure_name: str = '') ‑> None

Save a plotted figure to disk. If FigureName is not specified then the name is 'Figure'+figure_number.

Args

figure_number
figure number.
figure_name
figure name.
def set_figure(figure_number: int = 1, subplot: int = 111) ‑> None

Set the active figure and plot for subsequent plot commands. A single plot is '111', a top plot of 2 is '211' and the bottom is '212'.

Args

figure_number
figure number.
subplot
subplot ID.
def tools(figure_number=1, include_motion: bool = 0) ‑> None

Starts interactive plotting tool for a Figure. Updates data fron plot events. Data may be read from get_data().

Args

figure_number
figure number.
include_motion
True to include mouse motion within axes as an event
def update() ‑> None

Use this method in a loop to update a plot in real-time.