public class HPlotXY extends Object
| Constructor and Description |
|---|
HPlotXY()
Construct a HPlotXY canvas with a single plot with the size 600x400.
|
HPlotXY(boolean set)
Create canvas for custom plots.
|
HPlotXY(String title)
Construct a HPlotXY canvas with a plot with the size 600x400.
|
HPlotXY(String title,
int xsize,
int ysize)
Create a plotting canvas.
|
HPlotXY(String title,
int xsize,
int ysize,
boolean set)
Create canvas with a certain size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the canvas (and dispose all components).
|
void |
doc()
Show online documentation.
|
org.jplot2d.element.XYGraph |
draw(double[] x,
double[] y,
String name)
Plot X-Y data
|
org.jplot2d.element.XYGraph |
draw(F1D f1d)
Draw a function.
|
org.jplot2d.element.XYGraph |
draw(H1D histogram)
Plot 1D histogram.
|
org.jplot2d.element.XYGraph |
draw(P1D p1d)
Draw P1D array with errors.
|
void |
draw(org.jplot2d.element.XYGraph xl)
Draw an arbitrary graph.
|
void |
export(String file)
Fast export of the canvas to an image file.
|
org.jplot2d.element.Axis |
getAxis(int axis)
Get the axis object.
|
org.jplot2d.env.RenderEnvironment |
getEnv()
Get drawing factory for custom plots.
|
org.jplot2d.element.ElementFactory |
getFactory()
Get drawing factory for custom plots.
|
JFrame |
getFrame()
Get grame that keeps averything
|
org.jplot2d.element.Layer |
getLayer()
Get drawing layer.
|
org.jplot2d.swing.JPlot2DComponent |
getPanel()
Get drawing panel.
|
org.jplot2d.element.Plot |
getPlot()
Return the plotting area.
|
String |
getTitle()
Return title of this plotter.
|
void |
setAxis(org.jplot2d.element.Axis xaxis,
org.jplot2d.element.Axis yaxis)
Set axis
|
void |
setGTitle(String sname)
Set the global title with default attributes.
|
void |
setGTitle(String sname,
Color c)
Set the global title with default attributes.
|
void |
setGTitle(String sname,
Font f,
Color c)
Set global title and its attributes
|
void |
setGTitle(org.jplot2d.element.Title title)
Set title as an object.
|
void |
setLogScale(int axis,
boolean b)
Sets true or false to plot on a log scale.
|
void |
setNameX(String s)
Sets the name for X axis.
|
void |
setNameY(String s)
Sets the name for Y axis.
|
void |
setRange(double minX,
double maxX,
double minY,
double maxY)
Sets the range for the current plot
|
void |
setRangeX(double min,
double max)
Sets the range (min-max) displayed on X
|
void |
setRangeY(double min,
double max)
Sets the range (min-max) displayed on Y
|
void |
update()
Update the current canvas.
|
void |
visible()
Set the canvas frame visible
|
void |
visible(boolean vs)
Set the canvas frame visible or not
|
public HPlotXY(String title, int xsize, int ysize, boolean set)
title - Titlexsize - size in x directionysize - size in y directionset - if true, we preset all graphics options. If false, only the
most basic options are created and the user should design the
plots yourself.public HPlotXY(String title, int xsize, int ysize)
title - Titlexsize - size in x directionysize - size in y directionpublic HPlotXY(boolean set)
title - Titleset - if false, a user should create a custom canvas.public HPlotXY(String title)
title - Titlepublic HPlotXY()
public void setNameX(String s)
s - Title for X axis.public void setNameY(String s)
s - Title for Y axis.public void setGTitle(String sname, Font f, Color c)
sname - namef - fontc - colorpublic void setGTitle(org.jplot2d.element.Title title)
title - public void setGTitle(String sname, Color c)
sname - Titlec - colorpublic void setGTitle(String sname)
sname - Titlepublic void setRangeX(double min,
double max)
min - minimum value on the axismax - maximum value on the axispublic void setRangeY(double min,
double max)
min - minimum value on the axismax - maximum value on the axispublic void setRange(double minX,
double maxX,
double minY,
double maxY)
minX - Min value in XmaxX - Max value in XminY - Min value in YmaxY - Max value in Ypublic org.jplot2d.element.Axis getAxis(int axis)
public void setAxis(org.jplot2d.element.Axis xaxis,
org.jplot2d.element.Axis yaxis)
xaxis - Y-axisyaxis - Y-axispublic void setLogScale(int axis,
boolean b)
axis - defines to which axis this function applies. 0 means X, 1
means Y.b - toggle, true if the scaling is logarithmicpublic void visible(boolean vs)
vs - (boolean) true: visible, false: not visiblepublic void visible()
public void update()
public void export(String file)
No questions will be asked and existing file will be rewritten
file - Output file with the proper extension (SVG, SVGZ, PNG, PDF,
EPS). If no extension, PNG file is assumed.public void doc()
public String getTitle()
public void close()
public void draw(org.jplot2d.element.XYGraph xl)
xl - public org.jplot2d.element.XYGraph draw(H1D histogram)
histogram - input H1D histogrampublic org.jplot2d.element.XYGraph draw(P1D p1d)
p1d - P1D array with errorsgraph - to style;public org.jplot2d.element.XYGraph draw(double[] x,
double[] y,
String name)
x - X arrayy - Y arraypublic org.jplot2d.element.Plot getPlot()
public org.jplot2d.swing.JPlot2DComponent getPanel()
public JFrame getFrame()
public org.jplot2d.element.ElementFactory getFactory()
public org.jplot2d.env.RenderEnvironment getEnv()
public org.jplot2d.element.Layer getLayer()
public org.jplot2d.element.XYGraph draw(F1D f1d)
f1d - input function;DMelt 2.0 © DataMelt by jWork.ORG