Package cnuphys.splot.plot
Class PlotParameters
java.lang.Object
cnuphys.splot.plot.PlotParameters
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPlotLine
(PlotLine line) Add a plot line to the plotboolean
Check whether we should draw extra textGet the axes fontGet the extra text fill colorGet the extra text border colorGet the extra text fontGet the extra text colorString[]
Get the extra strings for a second legend like displayint
Get the legend line lengthdouble
Get the maximum value for a manual X rangedouble
Get the minimum value for a manual X rangedouble
Get the maximum value for a manual Y rangedouble
Get the minimum value for a manual Y rangeint
The exponent where we switch to scientific notation on the x axisint
The exponent where we switch to scientific notation on the y axisint
The number of decimals for tick values on x axisint
The number of decimals for tick values on y axisGet all the plot linesGet the plot titleGet the status fontGet the legend fill colorGet the legend border colorGet the legend fontGet the legend text colorGet the title fontGet the label for the x axisGet the limit method for the x axisGet the label for the y axisGet the limit method for the y axisboolean
Check whether we should draw a gradientboolean
Check whether to include x = 0boolean
Check whether to include y = 0boolean
Check whether the extra text border is drawnboolean
Check whether the legend border is drawnboolean
Check whether we should draw a legendvoid
mustIncludeXZero
(boolean incZero) Force the plot to include x = 0void
mustIncludeYZero
(boolean incZero) Force the plot to include y = 0void
removePlotLine
(PlotLine line) Remove a plot line from the plotvoid
setAxesFont
(Font font) Set the axes fontvoid
setExtraBackground
(Color color) Set the extra text fill colorvoid
setExtraBorder
(boolean extraBorder) Set whether the extra text border is drawnvoid
setExtraBorderColor
(Color color) Set the extra text border colorvoid
setExtraDrawing
(boolean draw) Set whether we should draw the extra textvoid
setExtraFont
(Font font) Set the extra text fontvoid
setExtraForeground
(Color color) Set the extra text colorvoid
setExtraStrings
(String... extraStrings) Set the extra strings for a second legend like displayvoid
setGradientDrawing
(boolean draw) Set whether we should draw a gradientvoid
setLegendBorder
(boolean legBorder) Set whether the legend border is drawnvoid
setLegendDrawing
(boolean draw) Set whether we should draw a legendvoid
setLegendLineLength
(int legLineLen) Set the legend line lengthvoid
setMinExponentX
(int minExponentX) Set the exponent where we switch to scientific notation on the x axisvoid
setMinExponentY
(int minExponentY) Set the exponent where we switch to scientific notation on the y axisvoid
setNumDecimalX
(int numDecimalX) Set the number of decimals for tick values on x axisvoid
setNumDecimalY
(int numDecimalY) Set the number of decimals for tick values on y axisvoid
setPlotTitle
(String title) Set the plot titlevoid
setStatusFont
(Font font) Set the status fontvoid
setTextBackground
(Color color) Set the legend fill colorvoid
setTextBorderColor
(Color color) Set the legend border colorvoid
setTextFont
(Font font) Set the legend fontvoid
setTextForeground
(Color color) Set the legend text colorvoid
setTitleFont
(Font font) Set the title fontvoid
Set the x axis labelvoid
setXLimitsMethod
(LimitsMethod method) Set the limits method for the x axisvoid
setXRange
(double xmin, double xmax) Manually set the x rangevoid
Set the y axis labelvoid
setYLimitsMethod
(LimitsMethod method) Set the limits method for the y axisvoid
setYRange
(double ymin, double ymax) Manually set the y range
-
Constructor Details
-
PlotParameters
Create plot parameters for a canvas- Parameters:
canvas
- the canvas
-
-
Method Details
-
mustIncludeXZero
public void mustIncludeXZero(boolean incZero) Force the plot to include x = 0- Parameters:
incZero
- the flag
-
mustIncludeYZero
public void mustIncludeYZero(boolean incZero) Force the plot to include y = 0- Parameters:
incZero
- the flag
-
getExtraStrings
Get the extra strings for a second legend like display- Returns:
- the extra strings
-
setExtraStrings
Set the extra strings for a second legend like display- Parameters:
extraStrings
- the new extra strings array
-
isExtraBorder
public boolean isExtraBorder()Check whether the extra text border is drawn- Returns:
true
if the extra text border is drawn.
-
setExtraBorder
public void setExtraBorder(boolean extraBorder) Set whether the extra text border is drawn- Parameters:
extraBorder
-true
if the extra text border is drawn.
-
isLegendBorder
public boolean isLegendBorder()Check whether the legend border is drawn- Returns:
true
if the legend border is drawn.
-
setLegendBorder
public void setLegendBorder(boolean legBorder) Set whether the legend border is drawn- Parameters:
legBorder
-true
if the legend border is drawn.
-
setTextBackground
Set the legend fill color- Parameters:
color
- the legendfill color
-
getTextBackground
Get the legend fill color- Returns:
- the legend fill color
-
setTextForeground
Set the legend text color- Parameters:
color
- the legend text color
-
getTextForeground
Get the legend text color- Returns:
- the legend text color
-
getTextBorderColor
Get the legend border color- Returns:
- the legend border color
-
setTextBorderColor
Set the legend border color- Parameters:
color
- the legend border color
-
setTextFont
Set the legend font- Parameters:
font
- the legend font
-
getTextFont
Get the legend font- Returns:
- the legend font
-
setExtraBackground
Set the extra text fill color- Parameters:
color
- the extra text fill color
-
getExtraBackground
Get the extra text fill color- Returns:
- the extra text fill color
-
setExtraForeground
Set the extra text color- Parameters:
color
- the extra text color
-
getExtraForeground
Get the extra text color- Returns:
- the extra text color
-
getExtraBorderColor
Get the extra text border color- Returns:
- the extra text border color
-
setExtraBorderColor
Set the extra text border color- Parameters:
color
- the extra text border color
-
setExtraFont
Set the extra text font- Parameters:
font
- the new extra text font
-
getExtraFont
Get the extra text font- Returns:
- the extra text font
-
setTitleFont
Set the title font- Parameters:
font
- the new title font
-
getTitleFont
Get the title font- Returns:
- the title font
-
setAxesFont
Set the axes font- Parameters:
font
- the new axes font
-
getAxesFont
Get the axes font- Returns:
- the axes font
-
setStatusFont
Set the status font- Parameters:
font
- the new status font
-
getStatusFont
Get the status font- Returns:
- the status font
-
setLegendLineLength
public void setLegendLineLength(int legLineLen) Set the legend line length- Parameters:
legLineLen
- the line length in pixels
-
getLegendLineLength
public int getLegendLineLength()Get the legend line length- Returns:
- legLineLen the line length in pixels
-
includeXZero
public boolean includeXZero()Check whether to include x = 0- Returns:
true
if we should include x = 0
-
includeYZero
public boolean includeYZero()Check whether to include y = 0- Returns:
true
if we should include y = 0
-
addPlotLine
Add a plot line to the plot- Parameters:
line
- the line to add
-
removePlotLine
Remove a plot line from the plot- Parameters:
line
- the line to remove
-
getPlotLines
Get all the plot lines- Returns:
- all the plot lines
-
getPlotTitle
Get the plot title- Returns:
- the plot title
-
setPlotTitle
Set the plot title- Parameters:
title
- the plot title
-
getXLabel
Get the label for the x axis- Returns:
- the label for the x axis
-
getYLabel
Get the label for the y axis- Returns:
- the label for the y axis
-
setXLabel
Set the x axis label- Parameters:
label
- the plot x axis label
-
setYLabel
Set the y axis label- Parameters:
label
- the plot y axis label
-
extraDrawing
public boolean extraDrawing()Check whether we should draw extra text- Returns:
- whether we should draw the extra text
-
setExtraDrawing
public void setExtraDrawing(boolean draw) Set whether we should draw the extra text- Parameters:
draw
- the new drawing flag
-
isLegendDrawn
public boolean isLegendDrawn()Check whether we should draw a legend- Returns:
- whether we should draw a legend
-
setLegendDrawing
public void setLegendDrawing(boolean draw) Set whether we should draw a legend- Parameters:
draw
- the new drawing flag
-
gradientDrawing
public boolean gradientDrawing()Check whether we should draw a gradient- Returns:
- whether we should draw a legend
-
setGradientDrawing
public void setGradientDrawing(boolean draw) Set whether we should draw a gradient- Parameters:
draw
- the new drawing flag
-
getNumDecimalX
public int getNumDecimalX()The number of decimals for tick values on x axis- Returns:
- the numDecimalX
-
setNumDecimalX
public void setNumDecimalX(int numDecimalX) Set the number of decimals for tick values on x axis- Parameters:
numDecimalX
- the numDecimalX to set
-
getMinExponentX
public int getMinExponentX()The exponent where we switch to scientific notation on the x axis- Returns:
- the minExponentX
-
setMinExponentX
public void setMinExponentX(int minExponentX) Set the exponent where we switch to scientific notation on the x axis- Parameters:
minExponentX
- the minExponentX to set
-
getNumDecimalY
public int getNumDecimalY()The number of decimals for tick values on y axis- Returns:
- the numDecimalY
-
setNumDecimalY
public void setNumDecimalY(int numDecimalY) Set the number of decimals for tick values on y axis- Parameters:
numDecimalY
- the numDecimalY to set
-
getMinExponentY
public int getMinExponentY()The exponent where we switch to scientific notation on the y axis- Returns:
- the minExponentY
-
setMinExponentY
public void setMinExponentY(int minExponentY) Set the exponent where we switch to scientific notation on the y axis- Parameters:
minExponentY
- the minExponentY to set
-
setXRange
public void setXRange(double xmin, double xmax) Manually set the x range- Parameters:
xmin
- the minimum xxmax
- the maximum x
-
setYRange
public void setYRange(double ymin, double ymax) Manually set the y range- Parameters:
xmin
- the minimum yxmax
- the maximum y
-
getManualXMin
public double getManualXMin()Get the minimum value for a manual X range- Returns:
- the value for a manual X range
-
getManualXMax
public double getManualXMax()Get the maximum value for a manual X range- Returns:
- the value for a manual X range
-
getManualYMin
public double getManualYMin()Get the minimum value for a manual Y range- Returns:
- the value for a manual Y range
-
getManualYMax
public double getManualYMax()Get the maximum value for a manual Y range- Returns:
- the value for a manual Y range
-
getXLimitsMethod
Get the limit method for the x axis- Returns:
- the limit method for the x axis
-
setXLimitsMethod
Set the limits method for the x axis- Parameters:
method
- the method
-
getYLimitsMethod
Get the limit method for the y axis- Returns:
- the limit method for the y axis
-
setYLimitsMethod
Set the limits method for the y axis- Parameters:
method
- the method
-