get_xy_plot(xvals,
*ylists,
**kw)
|
|
Create a scatter or line chart. The line chart may optionally have
error bars associated with it. Multiple series can be plotted by passing
in more than one list of y values, i.e. get_xy_plot(x, y1, y2,
chart_type='scatter')
The plot is saved as an image file, the filename parameter should
contain the path to the file to write. filename is written and the value
of filename is simply returned.
- Parameters:
xvals (list) - the x values to plot
ylists (one or more lists) - Each y series to plot should be given as an argument to the
function, and each should be the same length as x
err_y (list of lists) - the i'th item of err_y is a list of numerical error bars, one for
each item in the i'th y list
chart_type (str) - type of chart to produce
-
scatter: scatterplot
-
line: line (default)
marker (tuple) - tuple of (symbol, color, size), only used for scatter plots
-
symbol (1-character str)
-
s - square ('square', rectangle accepted)
-
o - circle ('circle' accepted)
-
^ - triangle up ('arrow' accepted)
-
> - triangle right
-
< - triangle left
-
v - triangle down
-
d - diamond ('diamond' accepted)
-
p - pentagon
-
h - hexagon
-
8 - octagon
-
+ - plus ('cross' accepted)
-
x - x
-
color (str)
-
black
-
red
-
green
-
blue
-
purple
-
yellow
-
orange
-
violet
-
skyblue
-
gold
-
grey
-
size (int)
size (tuple) - (x, y) plot size
x_label (str) - X-axis label
y_label (str) - Y-axis label
x_range (tuple) - (min, max) values for the X-axis
y_range (tuple) - (min, max) values for the Y-axis
color (list) - list of color names to cycle through. See marker:color for some
color names.
bg (str) - color name for the plot background. See marker:color for some
color names.
legend (list) - list of strings, each item is the name of a y series in the
legend
title (str) - the title of the plot
dpi (int) - dots per inch for the plot
fontsize (int or str) - size in points, or one of the following -
-
xx-small
-
x-small
-
small
-
medium
-
large
-
x-large
-
xx-large
filename (str) - The pathway to a file that the image of this plot should be saved
in.
format (str) - the image format to save the chart in. Must be a
matplotlib-recognized format argument to
Figure.savefig(format=nnn). Default is nnn='png'
- Returns: filename
- The filename the image of the plot was saved into (same string as
passed in with the filename keyword).
|