|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjhplot.GHPanel
jhplot.GHFrame
jhplot.HPlot2D
public class HPlot2D
A class to build a contour (density) plots in 2D. Use it to show H2D histograms, F2D functions, density plots for P1D arrays.
Constructor Summary | |
---|---|
HPlot2D()
Construct a HChart canvas with a plot with the default parameters 600 by 400, and 10% space for the global title "Default" |
|
HPlot2D(String title)
Construct a HChart canvas with a plot with the default parameters 600 by 400, and 10% space for the global title |
|
HPlot2D(String title,
int xs,
int ys)
Construct a HChart canvas with a single plot/graph |
|
HPlot2D(String title,
int xs,
int ys,
boolean set)
Construct a HChart canvas with a single plot/graph |
|
HPlot2D(String title,
int xs,
int ys,
int n1,
int n2)
Construct a HChart canvas with plots/graphs |
|
HPlot2D(String title,
int xsize,
int ysize,
int n1,
int n2,
boolean set)
Create canvas with a several plots |
Method Summary | |
---|---|
void |
add(HLabel label,
double textHeight)
Add a label to the Canvas in NDC coordinates |
void |
clear()
Clear the current pad |
void |
clearAll()
Clear all pads |
void |
close()
Close the canvas (and dispose all components). |
void |
distroy()
Remove the canvas frame |
void |
doc()
Show online documentation. |
void |
draw(Cloud2D c2d)
Plot cloud 2D. |
void |
draw(F2D h)
Plot F2D function (x-y) as density plot |
void |
draw(H2D h)
Draw 2D histogram using a style (see setStyle()) |
void |
draw(Histogram2D h1d)
Draw 2D histogram |
void |
draw(P1D h)
Plot P1D data (x-y) as density plot |
sgtplot.Axis |
getAxis(int axis)
Return axis objects |
sgtplot.SGLabel |
getAxisTitle(int axis)
Get label title |
sgtplot.ColorKey |
getColorBar()
Get color bar (key) for the current plot |
sgtplot.swing.JPlotLayout |
getPlotCanvas()
Get the original canvas |
int |
getStyle()
Get current style |
void |
quit()
Quit the canvas (and dispose all components) Note: a memory leak is found - no time to study it. |
void |
setAutoRange()
Set autorange for the current plot |
void |
setAutoRange(boolean autorange)
Set autorange or not for the current plot |
void |
setAutoRange(int axis,
boolean autorange)
Set autorange for the current plot |
void |
setAutoRangeAll()
Set autorange in X and Y at the same time for all plots |
void |
setAxis(int axis,
sgtplot.Axis axisObject)
Set axis objects |
void |
setAxis(int axis,
boolean b)
Sets whether an axis line will be drawn or not. |
void |
setAxisLabelColor(Color color)
Sets the pen color for ticks |
void |
setAxisLabelFont(Font fnt)
Set fonts for axis Label |
void |
setAxisLabelPosition(int axis,
int labp)
Position of label for axis |
void |
setAxisNumberSubtics(int nstic)
Sets the number of small sub-ticks |
void |
setAxisPenTicWidth(int penWidth)
Sets the pen width to draw tick axes |
void |
setAxisTicHeight(int lthgt)
Sets the tick heights in NDC units |
void |
setAxisTitle(int axis,
sgtplot.SGLabel lab)
Set label for axis |
void |
setBackground(Color c)
Set background for the plot. |
void |
setColorBar(sgtplot.ColorKey k)
Set color bar (key) for the current plot |
void |
setData()
|
void |
setGTitle(String title)
Set global title for this plot. |
void |
setName(String title)
Set global title to the current chart |
void |
setNameX(String s)
Sets the name for X axis. |
void |
setNameY(String s)
Sets the name for Y axis. |
void |
setRange(int axis,
double min,
double max,
int bins)
Sets the range for the current plot and axis. |
void |
setStyle(int style)
Set style to the current plot. |
void |
setSubTicLength(int axis,
double length)
Sets the length of the sub-ticks. |
void |
showTest()
|
void |
update()
Update current canvas |
void |
visible()
Set the canvas frame visible |
void |
visible(boolean vs)
Set the canvas frame visible or not |
Methods inherited from class jhplot.GHFrame |
---|
addGraph, cd, componentHidden, componentMoved, componentShown, getCdX, getCdY, getFrame, getHTMLUrl, getNtotX, getNtotY, setPlotsNum, updateFrame |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HPlot2D(String title, int xsize, int ysize, int n1, int n2, boolean set)
title
- Titlexsize
- size in x directionysize
- size in y directionn1
- number of plots/graphs in xn2
- number of plots/graphs in yset
- set or not the graphpublic HPlot2D(String title, int xs, int ys)
title
- Title for the canvasxs
- size in xys
- size in ypublic HPlot2D(String title, int xs, int ys, boolean set)
title
- Title for the canvasxs
- size in xys
- size in yset
- set or not the graph (boolean)public HPlot2D(String title, int xs, int ys, int n1, int n2)
title
- Title for the canvasxs
- size in xys
- size in yn1
- number of plots/graphs in xn2
- number of plots/graphs in ypublic HPlot2D(String title)
title
- Titlepublic HPlot2D()
Method Detail |
---|
public void draw(Cloud2D c2d)
c2D
- Input 2D cloudpublic void draw(Histogram2D h1d)
h1d
- input istogram1Dpublic void draw(H2D h)
h
- input historampublic void add(HLabel label, double textHeight)
label
- Label to be addedpublic sgtplot.ColorKey getColorBar()
public void setColorBar(sgtplot.ColorKey k)
k
- keypublic void update()
public sgtplot.swing.JPlotLayout getPlotCanvas()
public void draw(P1D h)
h
- input P1Dpublic void draw(F2D h)
h
- input 2d functionpublic void setAutoRange()
public void setAutoRange(boolean autorange)
autorange
- true if autorangepublic void setAutoRange(int axis, boolean autorange)
axis
- axis (0=x, 1=y, 2=z)autorange
- true if autorangepublic void setRange(int axis, double min, double max, int bins)
axis
- apply for axis X (=0) or axis Y (=1) and axis Z (=2) for
contoursmin
- Min valuemax
- Max valuebins
- number of bins between min and maxpublic void setAutoRangeAll()
public void setName(String title)
title
- titlepublic void setNameX(String s)
s
- Title for X axis.public void setNameY(String s)
s
- Title for Y axis.public void setBackground(Color c)
c
- background color.public void setGTitle(String title)
setGTitle
in class GHPanel
title
- plot titlepublic void visible(boolean vs)
vs
- (boolean) true: visible, false: not visiblepublic void visible()
public void showTest()
public void setData()
public void setStyle(int style)
style
- 0 means RASTER style; public sgtplot.Axis getAxis(int axis)
axis
- axis =0 for X axis, and =1 for Y axis
public void setAxis(int axis, sgtplot.Axis axisObject)
axis
- axis =0 for X axis, and =1 for Y axisaxis
- objectpublic void setAxis(int axis, boolean b)
axis
- defines to which axis this function applies, generally
something like X_AXIS or Y_AXIS.b
- toggle, true if the axis should be drawn.public void setAxisLabelFont(Font fnt)
fnt
- fontpublic void setSubTicLength(int axis, double length)
axis
- defines to which axis this function applies, generally
something like X_AXIS or Y_AXIS.length
- subtick length relative to the axis lengthpublic void setAxisPenTicWidth(int penWidth)
penWidth
- pen width to draw the tick axes linespublic void setAxisLabelColor(Color color)
color
- pen color.public void setAxisNumberSubtics(int nstic)
nstic
- number of small tickspublic void setAxisTicHeight(int lthgt)
lthgt
- height of ticks in NDC unitspublic void setAxisLabelPosition(int axis, int labp)
axis
- axis (0 for x, 1 for y)labp
- positionpublic sgtplot.SGLabel getAxisTitle(int axis)
public void setAxisTitle(int axis, sgtplot.SGLabel lab)
lab
- labelpublic int getStyle()
public void doc()
public void clearAll()
public void clear()
public void distroy()
public void close()
public void quit()
|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |