Release: ©2009, v 0.1 Oct 2009 byjah A plotting library using matplotlib. Requires external libary mx.DateTime found in eGenix mx Base.
Usage is based on instantiating suitable class with figure size (in pixels) and dpi, and calling its plotting method(s) with a dictionary containing data and other required/optional information. See documentation of individual classes and methods.
- Revision history:
- Oct 2009 first (0.1) version partially based on jahplotlib.py
Common base class for plotting classes.
Create a figure with nplots subplots with ncols columns (number of rows automatically calculated). If figure allready exists, return next subfig.
nplots | total number of plots |
useAxesGrid | use AxesGrid instead of “normal” figure, default: True |
axesPad | padding (used with useAxesGrid) |
Return list of all subplot axes (self.axes) if useAxesGrid==False, otherwise return ???
Bases: jahplotlib_ng._cPlotBase
Plot (x,y) plots, where x can also be mx.DateTime or python datetime.
size | fig size in pixels, “width,height” |
dpi | dots-per-inch |
Do x,y plot based on data/metadata in dict dd (and/or x,y). Write out graphic file(s) named in figfiles list. All the texts (labels, legends, ...) are plotted as mathtext if $...$. Most of the options (dd keys) have relatively usable defaults. Currently only one x- and y-axis/subfigure. All the plots have common x-axis scale (i.e. min/max). Uses AxesGrid from matplotlib toolkits.
Can plot only ONE PLOT/subfigure, but with several subfigures stacked vertically. Can handle missing values (== None).
dd | data dictionary |
figfiles | (list of) result file(s), default: test.png |
x | ‘x’: dd[‘x’], otherwise list (see dd[‘x’] below) |
y | ‘y’: dd[‘y’], otherwise list (see dd[‘y’] below) |
Data dict (dd) keys:
- ‘x’
- [] all the plots have common x-list [[]] several subplots with separate x-vals
- ‘y’
- [] for one fig, or [[]] several subplots
- ‘xerr’
- x error (symmetric) in x units, format: see ‘x’ above -> ErrorBar plotting
- ‘yerr’
- y error (symmetric) in y units, format: see ‘y’ above -> ErrorBar plotting
- ‘kwargs’
[{}] passed to pylab plot command
- ‘linestyle’,’ls’
- ‘-‘ ‘–’ ‘-.’ ‘:’ ‘steps’ ‘None’
- ‘linewidth’,’lw’
- points
- ‘marker’
- ‘+’ ‘,’ ‘.’ ‘1’ ‘2’ ‘3’ ‘4’ ‘<’ ‘>’ ‘D’ ‘H’ ‘^’ ‘_’ ‘d’ ‘h’ ‘o’ ‘p’ ‘s’ ‘v’ ‘x’ ‘|’
- ‘markeredgecolor’,’mec’
- color
- ‘markeredgewidth’,’mew’
- points
- ‘markerfacecolor’,’mfc’
- color
- ‘markersize’,’ms’
- points
- ‘color’,’c’
- line color
- ‘frame’
- {‘left’:,’bottom’:,’right’:,’wspace”:,’hspace’:} (0-1)
- ‘xlabel’
- ‘x-axis label’
- ‘ylabel’
- [‘y axis label(s)’]
- ‘title’
- title
- ‘legend’
- [‘data legend(s)’]
- ‘grid’
- ‘x’, ‘y’ or ‘xy’
- ‘text’
- (xpos,ypos,”text”,kwargs)
- ‘yticklabelsize’
- size in points
- ‘xticklabelsize’
- size in points
- ‘legendfontsize’
- size in points
- ‘axhline’
- [True/False], horisontal line at y==0
- ‘yminmax’
- [(ymin,ymax)]
- ‘yminminmaxmax’
- [(yminmin,ymaxmax)]