public class WPlot extends Object
| Constructor and Description |
|---|
WPlot()
Construct a frame with a canvas.
|
WPlot(int width,
int height)
Construct a frame with the plot.
|
WPlot(String title)
Construct a frame with a canvas.
|
WPlot(String title,
int width,
int height)
Construct a frame with the plot.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLegend(int dataset,
String legend)
Add a legend (displayed at the upper right) for the specified data set
with the specified string.
|
void |
addXTick(String label,
double position)
Specify a tick mark for the X axis.
|
void |
clear()
Clear the plot of all data points.
|
void |
clear(int dataset)
Clear the plot of data points in the specified dataset.
|
void |
clearLegends()
Clear all legends.
|
void |
doc()
Show online documentation.
|
void |
draw(double[] x,
double[] y)
Draw a single data set as marks (default).
|
void |
draw(double[] x,
double[] y,
String opt)
Draw X-Y data.
|
void |
draw(F1D f1d)
Draw a F1D function.
|
void |
draw(F1D f1d,
String opt)
Draw a function.
|
void |
draw(H1D h1)
Draw H1D histograms
|
void |
draw(P0D p0d)
Draw P0D array as a pie chart.
|
void |
draw(P0I p0d)
Draw P0I array as a pie chart.
|
void |
draw(P1D p1d)
Draw P1D array in X-Y space.
|
void |
draw(P1D p1d,
String opt)
Draw P1D array in X-Y space.
|
void |
drawContour(P1D p1d)
Draw a s
|
void |
export(String f)
Fast export of the canvas to an image file (depends on the extension,
i.e.
|
boolean |
getAntiAlias()
Get antialiasing for the graphics of the current plot
|
kcl.waterloo.graphics.GJGraphContainer |
getContainer()
Get the graph container.
|
jhplot.gui.WPlotFrame |
getFrame()
Get the frame with the plot.
|
kcl.waterloo.graphics.GJGraph |
getGraph()
Get the graph with the plot.
|
kcl.waterloo.graphics.plots2D.GJPlotInterface |
getPlotInterface()
Get the graph with the plot.
|
static void |
main(String[] args) |
void |
setAntiAlias(boolean setit)
Set antialiasing for the graphics of the current plot
|
void |
setAutoRange()
Rescale so that the data that is currently plotted just fits.
|
void |
setAutoRange(boolean auto)
Rescale so that the data that is currently plotted just fits.
|
void |
setBackground(Color c)
Set background for the plot.
|
void |
setFontAxis(Font f)
Sets font for small ticks on X and Y axis.
|
void |
setForeground(Color foreground)
Set the foreground color.
|
void |
setGrid(boolean b)
Sets whether or not using grid lines.
|
void |
setGTitle(String title)
Set global title for this plot.
|
void |
setLabelFont(Font name)
Set the label font, which is used for axis labels and legend labels.
|
void |
setName(String label)
Set subtitle of the plot.
|
void |
setNameX(String label)
Set the label for the X (horizontal) axis.
|
void |
setNameY(String label)
Set the label for the Y (vertical) axis.
|
void |
setRange(double minX,
double maxX,
double minY,
double maxY)
Sets the range (min-max) displayed on X and Y
|
void |
setRange(int axis,
double min,
double max)
Sets the range (min-max) displayed on the axis.
|
void |
setTitleFont(String name)
Set font of the title.
|
void |
setXLog(boolean xlog)
Specify whether the X axis is drawn with a logarithmic scale.
|
void |
setYLog(boolean ylog)
Specify whether the Y axis is drawn with a logarithmic scale.
|
void |
setYRange(double min,
double max)
Set the Y (vertical) range of the plot.
|
void |
update()
Repaint the plot and update all graphics.
|
void |
visible()
Show the frame.
|
void |
visible(boolean showIt)
Show the frame or not?
|
public WPlot()
public WPlot(String title)
title - public WPlot(int width,
int height)
width - frame widthheight - frame heightpublic WPlot(String title, int width, int height)
title - i Titlewidth - frame widthheight - frame heightpublic void setAntiAlias(boolean setit)
setit - true if antialiasing is setpublic boolean getAntiAlias()
public void setFontAxis(Font f)
f - Fontpublic void setBackground(Color c)
c - background color.public void setGTitle(String title)
title - plot titlepublic void addLegend(int dataset,
String legend)
dataset - The dataset index.legend - The label for the dataset.#renameLegend(int, String)public void addXTick(String label, double position)
label - The label for the tick mark.position - The position on the X axis.public void clear()
public void clearLegends()
public void setForeground(Color foreground)
foreground - The foreground color.public void setLabelFont(Font name)
name - font name.public void setTitleFont(String name)
name - A font name.public void setNameX(String label)
label - The label.public void setXLog(boolean xlog)
xlog - If true, logarithmic axis is used.public void setRange(double minX,
double maxX,
double minY,
double maxY)
minX - minimum value on the X axismaxX - maximum value on the X axisminY - minimum value on the Y axismaxY - maximum value on the Y axispublic void setRange(int axis,
double min,
double max)
axis - defines to which axis this function applies: min - minimum value on the axismax - maximum value on the axispublic void setNameY(String label)
label - The label.public void setName(String label)
label - The label.public void setYLog(boolean ylog)
ylog - If true, logarithmic axis is used.public void setYRange(double min,
double max)
min - The bottom extent of the range.max - The top extent of the range.public void draw(double[] x,
double[] y)
x - array of x valuesy - array of y valuespublic void clear(int dataset)
dataset - The dataset to clear.public void setAutoRange()
public void setAutoRange(boolean auto)
auto - if true, then autorangepublic void update()
public void setGrid(boolean b)
b - true if shownpublic void draw(H1D h1)
h1 - H1D histogram to be shown.public void draw(P0D p0d)
p0d - P0D object to showpublic void draw(P0I p0d)
p0d - P0D object to showpublic void draw(P1D p1d)
p1d - X-Y + error datapublic void draw(double[] x,
double[] y,
String opt)
x - X datay - Y dataopt - option for how to plot? Options can be: PolarBar,public void draw(F1D f1d, String opt)
f1d - a functionopt - option for how to plot? Options can be: PolarBar,public void draw(F1D f1d)
f1d - a functionpublic void draw(P1D p1d, String opt)
p1d - data in X and Y plus error.opt - how to plot? Options can be: public jhplot.gui.WPlotFrame getFrame()
public kcl.waterloo.graphics.plots2D.GJPlotInterface getPlotInterface()
public kcl.waterloo.graphics.GJGraph getGraph()
public kcl.waterloo.graphics.GJGraphContainer getContainer()
public void visible(boolean showIt)
showIt - true if should be shownpublic void visible()
public void drawContour(P1D p1d)
p1d - public void export(String f)
f - Output file with the proper extension. If no extension, PNG
file is assumed. Other formats are PNG, PDF, EPS, PS, SVG.public void doc()
public static void main(String[] args)
DMelt 2.0 © DataMelt by jWork.ORG