public class Plot extends jyplot.JyplotVanilla implements Serializable
j = Plot() j.plot([1,2,3,2]) j.title("Some random plot") j.show() j.savefig(file='/tmp/someplot.png', 300, 200)Plots can vbe saved in png,jpg,eps,svg, and pdf formats.
Constructor and Description |
---|
Plot()
Create a default canvas
|
Plot(boolean enableJFrame)
For headless systems, there is the option of disabling the GUI.
|
Modifier and Type | Method and Description |
---|---|
void |
axhline(float y,
float xmin,
float xmax,
float linewidth,
Color color)
Creates a horizontal line along the x axis.
|
org.jfree.data.general.Dataset |
bar(org.python.core.PyObject[] args,
String[] kws)
Plot an arbitrary number of bars (boxes)
|
void |
draw(double[] x,
double[] y)
Plot Y vs X.
|
void |
draw(F1D f1)
Plot F1D function.
|
void |
draw(P1D p)
Plot P1D object.
|
org.jfree.data.general.Dataset |
errorbar(double[] x,
double[] y,
double[] xerr,
double[] yerr,
String label,
Color color,
Color cerr,
int capsize,
boolean barsabove)
Sets the figure size.
|
void |
export(String file)
Fast export of the canvas to an image file (depends on the extension,
i.e.
|
void |
figure(org.python.core.PyObject[] args,
String[] kws)
Sets the figure size.
|
void |
legendtest(org.python.core.PyObject[] args,
String[] kws)
Sets the legend labels and location.
|
org.jfree.data.general.Dataset |
loglog(org.python.core.PyObject[] args,
String[] kws) |
static void |
main(String[] args) |
org.jfree.data.general.Dataset |
plot(org.python.core.PyObject[] args,
String[] kws)
Sets the figure size.
|
void |
savefig(String filename)
This assumes
|
void |
savefig(String filename,
int width,
int height) |
org.jfree.data.general.Dataset |
semilogx(org.python.core.PyObject[] args,
String[] kws)
Make a semilog plot with log scaling on the x axis.
|
org.jfree.data.general.Dataset |
semilogy(org.python.core.PyObject[] args,
String[] kws) |
void |
setp(org.python.core.PyObject[] args,
String[] kws) |
void |
xticksa(org.python.core.PyObject[] args,
String[] kws) |
axis, bar, bar, bar, bar, bar, clf, color, color, color, color, connect, difference, drawToGraphics2D, errorbar, getChart, getChart, getChartPanelMap, getChartToPanelMap, getColor, getCols, getFrame, getJpanel, getRows, grid, gridx, gridy, hist, hist, hist, label, legend, linecolor, linestyle, linewidth, loglog, loglog, plot, plot, plot, plot, setAntiAlias, setBackgColor, setChart, setChartToPanelMap, setDomainSpace, setFrame, setJpanel, setQuitOnWindowClose, setRangeSpace, setShapesVisible, show, show, subplot, subplot, text, title, title, xlabel, xlim, xticks, xticks, ylabel, ylim, yticks
public Plot()
public Plot(boolean enableJFrame)
enableJFrame
- true by defaultpublic void export(String file)
file
- Output file with the proper extension. If no extension, PNG
file is assumed.public void axhline(float y, float xmin, float xmax, float linewidth, Color color)
Jython documentation
axhline(y=0, xmin=0, xmax=1, **kwargs)
Draw a horizontal line at y from xmin to xmax. With the default values of xmin=0 and xmax=1, this line will always span the horizontal extent of the axes, regardless of the xlim settings, even if you change them, eg with the xlim command. That is, the horizontal extent is in axes coords: 0=left, 0.5=middle, 1.0=right but the y location is in data coordinates.
kwargs are the same as kwargs to plot (however so far only "linewidth" and "color" are implemented) and can be used to control the line properties.
Eg:
draw a thick red hline at y=0 that spans the xrange
axhline(linewidth = 4, color = 'r')
draw a default hline at y=1 that spans the xrange
axhline(y = 1)
draw a default hline at y=.5 that spans the the middle half of the xrange
axhline(y = .5, xmin = 0.25, xmax = 0.75)
args
- Main arguments e.g. axhline(y=0, xmin=0, xmax=1kws
- Additional arguments e.g. color='r', linewidth=4public org.jfree.data.general.Dataset errorbar(double[] x, double[] y, double[] xerr, double[] yerr, String label, Color color, Color cerr, int capsize, boolean barsabove)
errorbar(x, y, yerr=None, xerr=None, fmt='b-', ecolor=None, capsize=3, barsabove=False
public void figure(org.python.core.PyObject[] args, String[] kws)
public void xticksa(org.python.core.PyObject[] args, String[] kws)
public void setp(org.python.core.PyObject[] args, String[] kws)
public void legendtest(org.python.core.PyObject[] args, String[] kws)
args
- kws
- public void savefig(String filename)
savefig
in class jyplot.JyplotVanilla
filename
- public void savefig(String filename, int width, int height)
savefig
in class jyplot.JyplotVanilla
public org.jfree.data.general.Dataset plot(org.python.core.PyObject[] args, String[] kws)
public org.jfree.data.general.Dataset bar(org.python.core.PyObject[] args, String[] kws)
bar(left, height, width=0.8, bottom=0, color=None, edgecolor=None, linewidth=None, yerr=None, xerr=None, ecolor=None, capsize=3, align='edge', orientation='vertical', log=False)Make a bar plot with rectangles bounded by left, left+width, bottom, bottom+height (left, right, bottom and top edges) left, height, width, and bottom can be either scalars or sequences.
args
- kws
- public org.jfree.data.general.Dataset semilogx(org.python.core.PyObject[] args, String[] kws)
public org.jfree.data.general.Dataset semilogy(org.python.core.PyObject[] args, String[] kws)
public org.jfree.data.general.Dataset loglog(org.python.core.PyObject[] args, String[] kws)
public static void main(String[] args)
public void draw(double[] x, double[] y)
x
- X valuesy
- Y vlauespublic void draw(P1D p)
p
- input P1Dpublic void draw(F1D f1)
f1
- input function.jHepWork 3.8 ©