java.lang.Object
ij.gui.Plot
- All Implemented Interfaces:
Cloneable
This class creates an image that line graphs, scatter plots and plots of vector fields
(arrows) can be drawn on and displayed.
Note that the clone() operation is a shallow clone: objects like arrays, the PlotProperties,
PlotObjects, the ImagePlus etc. of the clone remain the same as those of the original.
- Author:
- Wayne Rasband, Philippe CARL, CNRS, philippe.carl (AT) unistra.fr (log axes, arrows, ArrayList data), Norbert Vischer (overlay range arrows, 'R'eset range, filled plots, dynamic plots, boxes and whiskers, superscript), Michael Schmid (axis grid/ticks, resizing/panning/changing range, high-resolution, serialization)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Legend positionsstatic final int
Draw a histogram bar for each point (bars touch each other unless the x axis has categories set via the axis label.static final int
Legend positionsstatic final int
Deprecated.Not a fixed value any more, use getDrawingFrame() to get the drawing areastatic final int
Legend positionsstatic final int
Display points using a square box-shaped mark.static final int
Text justification.static final int
Display points using a circle (5 pixels in diameter if line thickness<=1, otherwise 7).static final int
Draw black lines between the dots and a circle with the given color at each dotstatic final int
Flag for copying from a template: copy axis stylestatic final int
Flag for copying from a template: copy contents stylestatic final int
Flag for copying PlotObjects (curves...) from a template if the template has more PlotObjects than the Plot to copy to.static final int
Flag for copying from a template: copy style & text of axis labelsstatic final int
Flag for copying from a template: copy legendstatic final int
Flag for copying from a template: copy plot sizestatic final int
Display points using an cross-shaped mark.static final int
Draw shape using macro codestatic final int
The default axisFlags, will be modified by PlotWindow.noGridLines and PlotWindow.noTicks (see getDefaultFlags)static final int
Display points using an diamond-shaped mark.static final int
Display points using a single pixel.static final int
Fill area between line plot and x-axis at y=0.static final int
Text justification.static final int
Deprecated.Not a fixed value any more, use getDrawingFrame() to get the drawing areastatic final int
Legend has its curves in bottom-to-top sequence (otherwise top to bottom)static final int
Legend erases background (otherwise transparent)static final int
Connect points with solid lines.static final int
minimum width of frame area in plotstatic final int
minimum width of frame area in plotstatic final String
key in ImagePlus properties to access the plot behind an ImagePlusstatic final int
Text justification.static final int
Deprecated.Not a fixed value any more, use getDrawingFrame() to get the drawing areastatic final int
Draw a free-standing bar for each point.static final int
Legend positionsstatic final int
Deprecated.Not a fixed value any more, use getDrawingFrame() to get the drawing areastatic final int
Legend positionsstatic final int
Display points using an tiangular mark.static final int
Display points using an X-shaped mark.static final int
flag for forcing frame to coincide with the grid/ticks in x direction (results in unused space)static final int
flag for drawing vertical grid lines for x axisstatic final int
flag for logarithmic x-axisstatic final int
flag for ticks (major and minor, if space) on logarithmic x axisstatic final int
flag for drawing minor ticks on linear (non-logarithmic) x axisstatic final int
flag for numeric labels of x-axis ticksstatic final int
Flag for addressing the x axis, for copying from a template: copy/write x axis range.static final int
flag for drawing major ticks on linear (non-logarithmic) x axisstatic final int
flag for forcing frame to coincide with the grid/ticks in y direction (results in unused space)static final int
flag for drawing horizontal grid lines for y axisstatic final int
flag for logarithmic y axisstatic final int
flag for ticks (major and minor, if space) on logarithmic y axisstatic final int
flag for drawing minor ticks on linear (non-logarithmic) y axisstatic final int
flag for numeric labels of x-axis ticksstatic final int
Flag for addressing the y axis, for copying from a template: copy/write y axis rangestatic final int
flag for drawing major ticks on linear (non-logarithmic) y axis -
Constructor Summary
ConstructorsConstructorDescriptionPlot
(ImagePlus imp, InputStream is) Constructs a new plot from an InputStream and closes the stream.Constructs a new Plot with the default options.Deprecated.Deprecated.Deprecated.Deprecated.This version of the constructor has a 'flags' argument for controlling whether ticks, grid, etc.Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a curve, set of points or error bars to this plot, where 'type' is "line", "connected circle", "filled", "bar", "separated bar", "circle", "box", "triangle", "diamond", "cross", "x", "dot", "error bars" or "xerror bars".void
Adds a curve or set of points to this plot, where 'type' is "line", "connected circle", "filled", "bar", "separated bar", "circle", "box", "triangle", "diamond", "cross", "x" or "dot".void
addErrorBars
(double[] errorBars) Adds vertical error bars to the last data passed to the plot (via the constructor or addPoints).void
addErrorBars
(float[] errorBars) Adds vertical error bars to the last data passed to the plot (via the constructor or addPoints).void
addErrorBars
(String dummy, float[] errorBars) void
addHistogram
(double[] values) Plots a histogram from an array using auto-binning.void
addHistogram
(double[] values, double binWidth) Plots a histogram from an array using the specified bin width.void
addHistogram
(double[] values, double binWidth, double binCenter) Plots a histogram of the value distribution (bin counts) from an arrayvoid
addHorizontalErrorBars
(double[] xErrorBars) Adds horizontal error bars to the last data passed to the plot (via the constructor or addPoints).void
addHorizontalErrorBars
(float[] xErrorBars) Adds horizontal error bars to the last data passed to the plot (via the constructor or addPoints).void
Draws text at the specified location, where (0,0) is the upper left corner of the the plot frame and (1,1) is the lower right corner.void
Adds an automatically positioned legend, where 'labels' can be a tab-delimited or newline-delimited list of curve or point labels in the sequence these data were added.void
Adds a legend at the position given in 'options', where 'labels' can be tab-delimited or newline-delimited list of curve or point labels in the sequence these data were added.int
addObjectFromPlot
(Plot plot, int i) Add the i-th PlotObject (in the sequence how they were added, including hidden ones) from another plot to this one.void
addPoints
(double[] x, double[] y, double[] errorBars, int shape) Adds a set of points to the plot or adds a curve if shape is set to LINE.void
addPoints
(double[] x, double[] y, int shape) Adds a set of points to the plot using double arrays.void
Adds a set of points to the plot or adds a curve if shape is set to LINE.void
addPoints
(float[] x, float[] y, int shape) Adds a set of points to the plot or adds a curve if shape is set to LINE.void
void
Adds a set of points to the plot using double ArrayLists.void
Adds a set of points to the plot using double ArrayLists.void
void
Appends the current plot to a virtual stack and resets allPlotObjects for next slice N.void
Adjusts a Calibration object to fit the current axes.void
static double
calculateDistance
(int x1, int y1, int x2, int y2) void
changeFont
(Font font) double
descaleX
(int x) Converts pixels to calibrated coordinates.double
descaleY
(int y) Converts pixels to calibrated coordinates.void
dispose()
Releases the ImageProcessor and ImagePlus associated with the plot.void
draw()
Draws the plot specified for the first time.void
drawArrow
(int x1, int y1, int x2, int y2, double size) Deprecated.Use as a public method is not supported any more because it is incompatible with rescalingvoid
drawDottedLine
(double x1, double y1, double x2, double y2, int step) Draws a line using the coordinate system defined by setLimits().void
drawLine
(double x1, double y1, double x2, double y2) Draws a line using the coordinate system defined by setLimits().void
drawNormalizedLine
(double x1, double y1, double x2, double y2) Draws a line using a normalized 0-1, 0-1 coordinate system, with (0,0) at the top left and (1,1) at the lower right corner.void
drawShapes
(String shapeType, ArrayList floatCoords) Adds a set of 'shapes' such as boxes and whiskersvoid
drawVectors
(double[] x1, double[] y1, double[] x2, double[] y2) Adds a set of points that will be drawn as ARROWs.void
drawVectors
(ArrayList x1, ArrayList y1, ArrayList x2, ArrayList y2) Adds a set of vectors to the plot using double ArrayLists.Returns the font currently used (e.g.float[][]
getDataObjectArrays
(int index) Get the data of the n-th Plot Object containing xy data in the sequence they were added (Other Plot Objects such as labels, arrows, lines, shapes and hidden PlotObjects are not counted).String[]
Gets an array with human-readable designations of the PlotObjects containing xy data in the sequence they were added.static int
The default flags, taking PlotWindow.noGridLines, PlotWindow.noTicks into accountReturns the default font for the plotdouble[]
Returns the rectangle where the data are plotted.int
getFlags()
Returns the flags that control the axesgetFont
(char c) Gets the font for xLabel ('x'), yLabel('y'), numbers ('f' for 'frame') or the legend ('l').Returns the plot as an ImagePlus.getLabel
(char c) Gets the label String of the xLabel ('x'), yLabel('y') or the legend ('l').double[]
Returns the current limits as an array xMin, xMax, yMin, yMax.The minimum plot size including borders, in pixels (at scale=1)int
Returns the number of PlotObjects (curves, labels, ...) passed with the constructor or added by 'add' or 'draw' methods.int
getObjectFlags
(char c) Gets the flags of the xLabel ('x'), yLabel('y') or the legend ('l').String[]
Gets an array with human-readable designations of the PlotObjects (curves, labels, ...) in the sequence they were added (the object passed with the constructor is first, even though it is plotted last).int
getPlotObjectIndex
(float[][] values) Returns the index of the first plot object with x,y data (points, line) or arrows with all data equal to those given.getPlotObjectLabel
(int i) Get the label the i-th PlotObject (in the sequence how they were added, including hidden ones).getPlotObjectStyle
(int i) Get the style of the i-th PlotObject (curve, label, ...) in the sequence they were added (including hidden ones), as String with comma delimiters: Main Color, Secondary Color (or "none"), Line Width [, Symbol shape for XY_DATA] [,hidden] PlotObjects here refers to curves, arrows, labels etc.Draws the plot (if not done before) in an ImageProcessor and returns the ImageProcessor with the plot.Creates a ResultsTable with the plot data.getResultsTable
(boolean writeFirstXColumn) Creates a ResultsTable with the data of the plot.Creates a ResultsTable with the data of the plot.getSize()
The size of the plot including borders with axis labels etc., in pixelsgetStack()
Returns the virtual stack created by addToStack().getTitle()
Returns the title of the image showing the plot (if any) or title of the plotString[]
getTypes()
Returns an array of the available curve types ("Line", "Bar", "Circle", etc).float[]
Get the x coordinates of the data set passed with the constructor (if not null) or otherwise of the data set of the first 'addPoints'.float[]
Get the y coordinates of the data set passed with the constructor (if not null) or otherwise of the data set of the first 'addPoints'.boolean
isFrozen()
void
Deletes the snapshot of the plot contents to make spacevoid
Deletes the snapshot of the plot properties to make spacemakeHighResolution
(String title, float scale, boolean antialiasedText, boolean showIt) Creates a new high-resolution plot by scaling it and displays that plot if showIt is true.void
void
Removes NaNs from the xValues and yValues arrays of all plot objects.void
Replaces the specified plot object (curve or set of points).void
Restores the plot contents (not including axis formats etc) from the snapshot previously created by savePlotObjects().void
Restores the plot properties (formatting, range etc., not PlotObjects such as data and corresponding curves etc.) from a snapshot previously created by savePlotPlotProperties.void
Creates a snapshot of the plot contents (not including axis formats etc), for later undo by restorePlotObjects.void
Creates a snapshot of the plot properties (formatting, range etc., not PlotObjects such as data and corresponding curves etc.), for later undo by restorePlotProperties.double
scaleXtoPxl
(double x) Converts calibrated coordinates to pixel coordinates.double
scaleYtoPxl
(double y) Converts calibrated coordinates to pixel coordinates.void
setAntialiasedText
(boolean antialiasedText) Determines whether to use antialiased text (default true)void
setAxes
(boolean xLog, boolean yLog, boolean xTicks, boolean yTicks, boolean xMinorTicks, boolean yMinorTicks, int tickLenght, int minorTickLenght) Sets the properties of the axes.void
setAxisLabelFont
(int style, float size) Sets the x and y label font size and style.void
setAxisXLog
(boolean axisXLog) Sets the X Axis format to Log or Linear.void
setAxisYLog
(boolean axisYLog) Sets the Y Axis format to Log or Linear.void
Set the plot frame background color.void
Set the plot frame background color.void
Changes the drawing color for the next objects that will be added to the plot.void
Changes the drawing color for the next objects that will be added to the plot.void
void
Sets the drawing colors for the next objects that will be added to the plot.void
Sets the font for xLabel ('x'), yLabel('y'), numbers ('f' for 'frame') or the legend ('l')void
setFont
(int style, float size) Sets the font size and style for all following addLabel() etc.void
Sets the font for all following addLabel() etc.void
setFontSize
(int size) Sets the font size for all following addLabel() etc.void
setFormatFlags
(int flags) Sets the flags that control the axes format.void
setFrameSize
(int width, int height) Sets the plot frame size in (unscaled) pixels.void
setFrozen
(boolean frozen) Freezes or unfreezes the plot.void
setImagePlus
(ImagePlus imp) Sets the ImagePlus where the plot will be displayed.void
setJustification
(int justification) Sets the justification used by addLabel(), wherejustification
is Plot.LEFT, Plot.CENTER or Plot.RIGHT.void
Sets the label for the plot object number 'index' in the sequence they were added.void
Adds a legend.void
setLimits
(double[] limits) Sets the current limits from an array xMin, xMax, yMin, yMax The array may be also longer or shorter, but should not contain NaN values.void
setLimits
(double xMin, double xMax, double yMin, double yMax) Sets the x-axis and y-axis range.void
setLimitsToDefaults
(boolean updateImg) Sets the plot range to the initial value determined from minima&maxima or given by setLimits.void
setLimitsToFit
(boolean updateImg) Sets the plot range to encompass all data.void
setLineWidth
(float lineWidth) Changes the line width for the next objects that will be added to the plot.void
setLineWidth
(int lineWidth) Changes the line width for the next objects that will be added to the plot.void
Sets log scale in x.void
void
setMaxIntervals
(int intervals) Sets the maximum number of intervals in a plot.void
setMinorTickLength
(int minorTickLength) Sets the length of the minor tick in pixels.void
setOptions
(String options) Sets options for the plot.void
setPlotMaker
(PlotMaker plotMaker) void
setPlotObjectLabel
(int i, String label) Set the label the i-th PlotObject (in the sequence how they were added, including hidden ones) PlotObjects here refers to curves, arrows, labels etc.void
setPlotObjectStyle
(int i, String styleString) void
reverts plot range to previous values and updates the imagevoid
setScale
(float scale) Sets the scale.void
setSize
(int width, int height) Sets the canvas size in (unscaled) pixels and sets the scale to 1.0.void
Sets the style of the specified PlotObject (curve, label, etc.) from a comma-delimited string ("color1,color2,lineWidth[,symbol][,hidden]"), where "color2" can be "none" and "symbol" and "hidden" are optional.void
setTickLength
(int tickLength) Sets the length of the major tick in pixels.void
setWindowSize
(int width, int height) Sets the plot window size in pixels.void
setXLabelFont
(Font font) Sets the xLabelFont; must not be null.void
setXMinorTicks
(boolean xMinorTicks) Sets whether to show minor ticks on the x axis (if linear).void
setXTicks
(boolean xTicks) Sets whether to show major ticks at the x axis.void
setXYLabels
(String xLabel, String yLabel) Sets the labels of the x and y axes.void
setYLabelFont
(Font font) Sets the yLabelFont; must not be null.void
setYMinorTicks
(boolean yMinorTicks) Sets whether to show minor ticks on the y axis (if linear).void
setYTicks
(boolean yTicks) Sets whether to show major ticks at the y axis.show()
Displays the plot in a PlotWindow.byte[]
Writes this plot into a byte array containing (1) the serialized PlotProperties and (2) the serialized Vector of all 'added' PlotObjects.static int
Returns the number for a given plot symbol shape, -1 for xError and -2 for yError (all case-insensitive)void
update()
Draws the plot again, ignored if the plot has not been drawn before or the plot is frozen.void
Draws the plot again, ignored if the plot has not been drawn before or the plot is frozen.void
useTemplate
(Plot plot) Adjusts the format with another plot as a template, using the current (usually default) templateFlags of this plot.void
useTemplate
(Plot plot, int templateFlags) Adjusts the format (style) with another plot as a template.
-
Field Details
-
LEFT
public static final int LEFTText justification.- See Also:
-
CENTER
public static final int CENTERText justification.- See Also:
-
RIGHT
public static final int RIGHTText justification.- See Also:
-
TOP_LEFT
public static final int TOP_LEFTLegend positions- See Also:
-
TOP_RIGHT
public static final int TOP_RIGHTLegend positions- See Also:
-
BOTTOM_LEFT
public static final int BOTTOM_LEFTLegend positions- See Also:
-
BOTTOM_RIGHT
public static final int BOTTOM_RIGHTLegend positions- See Also:
-
AUTO_POSITION
public static final int AUTO_POSITIONLegend positions- See Also:
-
LEGEND_BOTTOM_UP
public static final int LEGEND_BOTTOM_UPLegend has its curves in bottom-to-top sequence (otherwise top to bottom)- See Also:
-
LEGEND_TRANSPARENT
public static final int LEGEND_TRANSPARENTLegend erases background (otherwise transparent)- See Also:
-
CIRCLE
public static final int CIRCLEDisplay points using a circle (5 pixels in diameter if line thickness<=1, otherwise 7).- See Also:
-
X
public static final int XDisplay points using an X-shaped mark.- See Also:
-
LINE
public static final int LINEConnect points with solid lines.- See Also:
-
BOX
public static final int BOXDisplay points using a square box-shaped mark.- See Also:
-
TRIANGLE
public static final int TRIANGLEDisplay points using an tiangular mark.- See Also:
-
CROSS
public static final int CROSSDisplay points using an cross-shaped mark.- See Also:
-
DOT
public static final int DOTDisplay points using a single pixel.- See Also:
-
CONNECTED_CIRCLES
public static final int CONNECTED_CIRCLESDraw black lines between the dots and a circle with the given color at each dot- See Also:
-
DIAMOND
public static final int DIAMONDDisplay points using an diamond-shaped mark.- See Also:
-
CUSTOM
public static final int CUSTOMDraw shape using macro code- See Also:
-
FILLED
public static final int FILLEDFill area between line plot and x-axis at y=0.- See Also:
-
BAR
public static final int BARDraw a histogram bar for each point (bars touch each other unless the x axis has categories set via the axis label. x values should be sorted (ascending or descending)- See Also:
-
SEPARATED_BAR
public static final int SEPARATED_BARDraw a free-standing bar for each point. x values should be equidistant and sorted (ascending or descending)- See Also:
-
X_NUMBERS
public static final int X_NUMBERSflag for numeric labels of x-axis ticks- See Also:
-
Y_NUMBERS
public static final int Y_NUMBERSflag for numeric labels of x-axis ticks- See Also:
-
X_TICKS
public static final int X_TICKSflag for drawing major ticks on linear (non-logarithmic) x axis- See Also:
-
Y_TICKS
public static final int Y_TICKSflag for drawing major ticks on linear (non-logarithmic) y axis- See Also:
-
X_GRID
public static final int X_GRIDflag for drawing vertical grid lines for x axis- See Also:
-
Y_GRID
public static final int Y_GRIDflag for drawing horizontal grid lines for y axis- See Also:
-
X_FORCE2GRID
public static final int X_FORCE2GRIDflag for forcing frame to coincide with the grid/ticks in x direction (results in unused space)- See Also:
-
Y_FORCE2GRID
public static final int Y_FORCE2GRIDflag for forcing frame to coincide with the grid/ticks in y direction (results in unused space)- See Also:
-
X_MINOR_TICKS
public static final int X_MINOR_TICKSflag for drawing minor ticks on linear (non-logarithmic) x axis- See Also:
-
Y_MINOR_TICKS
public static final int Y_MINOR_TICKSflag for drawing minor ticks on linear (non-logarithmic) y axis- See Also:
-
X_LOG_NUMBERS
public static final int X_LOG_NUMBERSflag for logarithmic x-axis- See Also:
-
Y_LOG_NUMBERS
public static final int Y_LOG_NUMBERSflag for logarithmic y axis- See Also:
-
X_LOG_TICKS
public static final int X_LOG_TICKSflag for ticks (major and minor, if space) on logarithmic x axis- See Also:
-
Y_LOG_TICKS
public static final int Y_LOG_TICKSflag for ticks (major and minor, if space) on logarithmic y axis- See Also:
-
DEFAULT_FLAGS
public static final int DEFAULT_FLAGSThe default axisFlags, will be modified by PlotWindow.noGridLines and PlotWindow.noTicks (see getDefaultFlags)- See Also:
-
X_RANGE
public static final int X_RANGEFlag for addressing the x axis, for copying from a template: copy/write x axis range.- See Also:
-
Y_RANGE
public static final int Y_RANGEFlag for addressing the y axis, for copying from a template: copy/write y axis range- See Also:
-
COPY_SIZE
public static final int COPY_SIZEFlag for copying from a template: copy plot size- See Also:
-
COPY_LABELS
public static final int COPY_LABELSFlag for copying from a template: copy style & text of axis labels- See Also:
-
COPY_LEGEND
public static final int COPY_LEGENDFlag for copying from a template: copy legend- See Also:
-
COPY_AXIS_STYLE
public static final int COPY_AXIS_STYLEFlag for copying from a template: copy axis style- See Also:
-
COPY_CONTENTS_STYLE
public static final int COPY_CONTENTS_STYLEFlag for copying from a template: copy contents style- See Also:
-
COPY_EXTRA_OBJECTS
public static final int COPY_EXTRA_OBJECTSFlag for copying PlotObjects (curves...) from a template if the template has more PlotObjects than the Plot to copy to.- See Also:
-
LEFT_MARGIN
public static final int LEFT_MARGINDeprecated.Not a fixed value any more, use getDrawingFrame() to get the drawing areaThe default margin width left of the plot frame (enough for 5-digit numbers such as unscaled 16-bit- See Also:
-
RIGHT_MARGIN
public static final int RIGHT_MARGINDeprecated.Not a fixed value any more, use getDrawingFrame() to get the drawing areaThe default margin width right of the plot frame- See Also:
-
TOP_MARGIN
public static final int TOP_MARGINDeprecated.Not a fixed value any more, use getDrawingFrame() to get the drawing areaThe default margin width above the plot frame- See Also:
-
BOTTOM_MARGIN
public static final int BOTTOM_MARGINDeprecated.Not a fixed value any more, use getDrawingFrame() to get the drawing areaThe default margin width below the plot frame- See Also:
-
MIN_FRAMEWIDTH
public static final int MIN_FRAMEWIDTHminimum width of frame area in plot- See Also:
-
MIN_FRAMEHEIGHT
public static final int MIN_FRAMEHEIGHTminimum width of frame area in plot- See Also:
-
PROPERTY_KEY
key in ImagePlus properties to access the plot behind an ImagePlus- See Also:
-
-
Constructor Details
-
Plot
Constructs a new Plot with the default options. Use add(shape,xvalues,yvalues) to add curves.- Parameters:
title
- the window titlexLabel
- the x-axis label; see setXYLabels for seting categories on an axis via the labelyLabel
- the y-axis label; see setXYLabels for seting categories on an axis via the label- See Also:
-
Plot
Deprecated.Obsolete, replaced by "new Plot(title,xLabel,yLabel); add(shape,x,y);". -
Plot
Deprecated.Obsolete, replaced by "new Plot(title,xLabel,yLabel); add(shape,x,y);". -
Plot
This version of the constructor has a 'flags' argument for controlling whether ticks, grid, etc. are present and whether the axes are logarithmic -
Plot
public Plot(String title, String xLabel, String yLabel, float[] xValues, float[] yValues, int flags) Deprecated.Obsolete, replaced by "new Plot(title,xLabel,yLabel,flags); add(shape,x,y);". -
Plot
Deprecated.Obsolete, replaced by "new Plot(title,xLabel,yLabel,flags); add(shape,x,y);". -
Plot
Constructs a new plot from an InputStream and closes the stream. If the ImagePlus is non-null, its title and ImageProcessor are used, but the image displayed is not modified.- Throws:
IOException
ClassNotFoundException
-
Plot
Deprecated.Obsolete, replaced by "new Plot(title,xLabel,yLabel); add(shape,x,y);".
-
-
Method Details
-
toByteArray
public byte[] toByteArray()Writes this plot into a byte array containing (1) the serialized PlotProperties and (2) the serialized Vector of all 'added' PlotObjects. The plot should have been drawn already. Returns null on error (which should never happen). -
getTitle
Returns the title of the image showing the plot (if any) or title of the plot -
setLimits
public void setLimits(double xMin, double xMax, double yMin, double yMax) Sets the x-axis and y-axis range. Saves the new limits as default (so the 'R' field sets the limits to these). Updates the image if existing. Accepts NaN values to indicate auto-range. -
getLimits
public double[] getLimits()Returns the current limits as an array xMin, xMax, yMin, yMax. (note that ImageJ versions before to 1.52i have returned incorrect values in case of log axes) Note that future versions might return a longer array (e.g. for y2 axis limits) -
setLimits
public void setLimits(double[] limits) Sets the current limits from an array xMin, xMax, yMin, yMax The array may be also longer or shorter, but should not contain NaN values. This method should be used after the plot has been displayed. Does not update the plot; use updateImage() thereafter. Does not save the previous limits, i.e., leaves the default limits (for reset via the 'R' field) untouched. -
setOptions
Sets options for the plot. Multiple options may be separated by whitespace or commas. Note that whitespace surrounding the '=' characters is not allowed. Currently recognized options are: "addhspace=10 addvspace=5" Increases the left&right or top&bottom margins by the given number of pixels. "xinterval=30 yinterval=90" Sets interval between numbers, major ticks & grid lines (default intervals are used if the custom intervals would be too dense or too sparse) "xdecimals=2 ydecimals=-1" Sets the minimum number of decimals; use negative numbers for scientific notation. "msymbol=' \\u00d7 '" Sets multiplication symbol for scientific notation, here a cross with spaces. -
setSize
public void setSize(int width, int height) Sets the canvas size in (unscaled) pixels and sets the scale to 1.0. If the scale remains 1.0, this will be the size of the resulting ImageProcessor. When not called, the canvas size is adjusted for the plot size specified by setFrameSize() or setWindowSize(), or otherwise in Edit>Options>Plots.- See Also:
-
getSize
The size of the plot including borders with axis labels etc., in pixels -
setFrameSize
public void setFrameSize(int width, int height) Sets the plot frame size in (unscaled) pixels. This size does not include the borders with the axis labels. Also sets the scale to 1.0. This frame size in pixels divided by the data range defines the image scale. This method does not check for the minimum size MIN_FRAMEWIDTH, MIN_FRAMEHEIGHT. Note that the black frame will have an outer size that is one pixel larger (when plotted with a linewidth of one pixel).- See Also:
-
setWindowSize
public void setWindowSize(int width, int height) Sets the plot window size in pixels.- See Also:
-
getMinimumSize
The minimum plot size including borders, in pixels (at scale=1) -
useTemplate
Adjusts the format with another plot as a template, using the current (usually default) templateFlags of this plot.plot
may be null; then the call has no effect. -
useTemplate
Adjusts the format (style) with another plot as a template. Flags determine what to copy from the template; these can be X_RANGE, Y_RANGE, COPY_SIZE, COPY_LABELS, COPY_AXIS_STYLE, COPY_CONTENTS_STYLE (hidden items are ignored), and COPY_LEGEND.plot
may be null; then the call has no effect. -
setScale
public void setScale(float scale) Sets the scale. Everything, including labels, line thicknesses, etc will be scaled by this factor. Also multiplies the plot size by this value. Used for 'Create high-resolution plot'. Should be called before creating the plot. Note that plots with a scale different from 1.0 must not be shown in a PlotWindow, but only as simple image in a normal ImageWindow. -
setXYLabels
Sets the labels of the x and y axes. 'xLabel', 'yLabel' may be null. If a label has the form {txt1,txt2,txt3}, the corresponding axis will be labeled not by numbers but rather with the texts "txt1", "txt2" ... instead of 0, 1, ... In this special case, there will be no label for the axis on the plot. Call update() thereafter to make the change visible (if it is shown already). -
setMaxIntervals
public void setMaxIntervals(int intervals) Sets the maximum number of intervals in a plot. Call update() thereafter to make the change visible (if the image is shown already). -
setTickLength
public void setTickLength(int tickLength) Sets the length of the major tick in pixels. Call update() thereafter to make the change visible (if the image is shown already). -
setMinorTickLength
public void setMinorTickLength(int minorTickLength) Sets the length of the minor tick in pixels. -
setFormatFlags
public void setFormatFlags(int flags) Sets the flags that control the axes format. Does not modify the flags for logarithmic axes on/off and the FORCE2GRID flags. Call update() thereafter to make the change visible (if it is shown already). -
getFlags
public int getFlags()Returns the flags that control the axes -
setAxisXLog
public void setAxisXLog(boolean axisXLog) Sets the X Axis format to Log or Linear. Call update() thereafter to make the change visible (if it is shown already). -
setAxisYLog
public void setAxisYLog(boolean axisYLog) Sets the Y Axis format to Log or Linear. Call update() thereafter to make the change visible (if it is shown already). -
setXTicks
public void setXTicks(boolean xTicks) Sets whether to show major ticks at the x axis. Call update() thereafter to make the change visible (if the image is shown already). -
setYTicks
public void setYTicks(boolean yTicks) Sets whether to show major ticks at the y axis. Call update() thereafter to make the change visible (if the image is shown already). -
setXMinorTicks
public void setXMinorTicks(boolean xMinorTicks) Sets whether to show minor ticks on the x axis (if linear). Also sets major ticks if true and no grid is set. Call update() thereafter to make the change visible (if the image is shown already). -
setYMinorTicks
public void setYMinorTicks(boolean yMinorTicks) Sets whether to show minor ticks on the y axis (if linear). Also sets major ticks if true and no grid is set. Call update() thereafter to make the change visible (if the image is shown already). -
setAxes
public void setAxes(boolean xLog, boolean yLog, boolean xTicks, boolean yTicks, boolean xMinorTicks, boolean yMinorTicks, int tickLenght, int minorTickLenght) Sets the properties of the axes. Call update() thereafter to make the change visible (if the image is shown already). -
setLogScaleX
public void setLogScaleX()Sets log scale in x. Call update() thereafter to make the change visible (if the image is shown already). -
setLogScaleY
public void setLogScaleY() -
getDefaultFlags
public static int getDefaultFlags()The default flags, taking PlotWindow.noGridLines, PlotWindow.noTicks into account -
add
Adds a curve or set of points to this plot, where 'type' is "line", "connected circle", "filled", "bar", "separated bar", "circle", "box", "triangle", "diamond", "cross", "x" or "dot". Run Help>Examples>JavaScript>Graph Types to see examples. If 'type' is in the form "code:", the macro given is executed to draw the symbol; macro variables 'x' and 'y' are the pixel coordinates of the point, 'xval' and 'yval' are the plot data and 'i' is the index of the data point (starting with 0 for the first point in the array). The drawing including line thickness, font size, etc. be scaled by scale factor 's' (to make high-resolution plots work). Example: "code: setFont('sanserif',12*s,'bold anti');drawString(d2s(yval,1),x-14*s,y-4*s);" writes the y value for each point above the point. -
replace
Replaces the specified plot object (curve or set of points). Equivalent to add() if there are no plot objects. -
add
Adds a curve, set of points or error bars to this plot, where 'type' is "line", "connected circle", "filled", "bar", "separated bar", "circle", "box", "triangle", "diamond", "cross", "x", "dot", "error bars" or "xerror bars". -
addPoints
public void addPoints(float[] xValues, float[] yValues, float[] yErrorBars, int shape, String label) Adds a set of points to the plot or adds a curve if shape is set to LINE.- Parameters:
xValues
- the x coordinates, or null. If null, integers starting at 0 will be used for x.yValues
- the y coordinates (must not be null)yErrorBars
- error bars in y, may be nullshape
- CIRCLE, X, BOX, TRIANGLE, CROSS, DIAMOND, DOT, LINE, CONNECTED_CIRCLESlabel
- Label for this curve or set of points, used for a legend and for listing the plots
-
addPoints
public void addPoints(float[] x, float[] y, int shape) Adds a set of points to the plot or adds a curve if shape is set to LINE.- Parameters:
x
- the x coordinatesy
- the y coordinatesshape
- CIRCLE, X, BOX, TRIANGLE, CROSS, DIAMOND, DOT, LINE, CONNECTED_CIRCLES
-
addPoints
public void addPoints(double[] x, double[] y, int shape) Adds a set of points to the plot using double arrays. -
toShape
Returns the number for a given plot symbol shape, -1 for xError and -2 for yError (all case-insensitive) -
addPoints
Adds a set of points to the plot using double ArrayLists. Must be called before the plot is displayed. -
addPoints
public void addPoints(double[] x, double[] y, double[] errorBars, int shape) Adds a set of points to the plot or adds a curve if shape is set to LINE.- Parameters:
x
- the x-coodinatesy
- the y-coodinateserrorBars
- half-lengths of the vertical error bars, may be nullshape
- CIRCLE, X, BOX, TRIANGLE, CROSS, DIAMOND, DOT or LINE
-
addPoints
Adds a set of points to the plot using double ArrayLists. Must be called before the plot is displayed. -
getDoubleFromArrayList
-
drawVectors
public void drawVectors(double[] x1, double[] y1, double[] x2, double[] y2) Adds a set of points that will be drawn as ARROWs.- Parameters:
x1
- the x-coodinates of the beginning of the arrowy1
- the y-coodinates of the beginning of the arrowx2
- the x-coodinates of the end of the arrowy2
- the y-coodinates of the end of the arrow
-
drawShapes
Adds a set of 'shapes' such as boxes and whiskers- Parameters:
shapeType
- e.g. "boxes width=20"floatCoords
- eg[6][3] holding 1 Xval + 5 Yvals for 3 boxes
-
calculateDistance
public static double calculateDistance(int x1, int y1, int x2, int y2) -
drawVectors
Adds a set of vectors to the plot using double ArrayLists. Does not support logarithmic axes. Must be called before the plot is displayed. -
addErrorBars
public void addErrorBars(float[] errorBars) Adds vertical error bars to the last data passed to the plot (via the constructor or addPoints). -
addErrorBars
public void addErrorBars(double[] errorBars) Adds vertical error bars to the last data passed to the plot (via the constructor or addPoints). -
addHorizontalErrorBars
public void addHorizontalErrorBars(float[] xErrorBars) Adds horizontal error bars to the last data passed to the plot (via the constructor or addPoints). -
addHorizontalErrorBars
public void addHorizontalErrorBars(double[] xErrorBars) Adds horizontal error bars to the last data passed to the plot (via the constructor or addPoints). -
addLabel
Draws text at the specified location, where (0,0) is the upper left corner of the the plot frame and (1,1) is the lower right corner. Uses the justification specified by setJustification(). When called with the same position as the previous addLabel call, the text of that previous call is replaced -
addText
-
addLegend
Adds an automatically positioned legend, where 'labels' can be a tab-delimited or newline-delimited list of curve or point labels in the sequence these data were added. Hidden data sets are ignored. If 'labels' is null or empty, the labels of the data set previously (if any) are used. To modify the legend's style, call 'setFont' and 'setLineWidth' before 'addLegend'. -
addLegend
Adds a legend at the position given in 'options', where 'labels' can be tab-delimited or newline-delimited list of curve or point labels in the sequence these data were added. Hidden data sets are ignored; no labels (and no delimiters) should be provided for these. Apart from top to bottom and bottom to top (controlled by "bottom-to-top" in the options), the sequence may be altered by preceding numbers followed by double underscores, such as "1__Other Data Set\t0__First Data Set" (the number and double underscore won't be displayed). When this possibility is used, only items with double underscores will be shown in the legend (preceding double underscores without a number make the item appear in the legend without altering the sequence). If 'labels' is null or empty, the labels of the data set previously (if any) are used. To modify the legend's style, call 'setFont' and 'setLineWidth' before 'addLegend'. -
setLegend
Adds a legend. The legend will be always drawn last (on top of everything). To modify the legend's style, call 'setFont' and 'setLineWidth' before 'addLegend'- Parameters:
labels
- labels of the points or curves in the sequence of the data were added, tab-delimited or linefeed-delimited. The labels of the datasets will be set to these values. If null or not given, the labels set previously (if any) will be used. Hidden data sets are ignored; no labels (and no delimiters) should be provided for these. Apart from top to bottom and bottom to top (controlled by the LEGEND_BOTTOM_UP flag), the sequence may be altered by preceding numbers followed by double underscores, such as "1__Other Data Set\t0__First Data Set" (the number and double underscore won't be displayed). When this possibility is used, only items with double underscores will be shown in the legend (preceding double underscores without a number make the item appear in the legend without altering the sequence).flags
- Bitwise or of position (AUTO_POSITION, TOP_LEFT etc.), LEGEND_TRANSPARENT, and LEGEND_BOTTOM_UP if desired. Updates the image (if it is shown already).
-
setLabel
Sets the label for the plot object number 'index' in the sequence they were added. With index=-1, sets the label for the last object added. For x/y data, the label is used for the legend and as header in getResultsTableWithLabels. For Text/Label objects, it affects the label shown (but the plot is not redisplayed). -
removeNaNs
public void removeNaNs()Removes NaNs from the xValues and yValues arrays of all plot objects. -
getTypes
Returns an array of the available curve types ("Line", "Bar", "Circle", etc). -
setJustification
public void setJustification(int justification) Sets the justification used by addLabel(), wherejustification
is Plot.LEFT, Plot.CENTER or Plot.RIGHT. Default is LEFT. -
setColor
Changes the drawing color for the next objects that will be added to the plot. For selecting the color of the curve passed with the constructor, usesetColor
beforedraw
. The frame and labels are always drawn in black. -
setColor
-
setColor
Changes the drawing color for the next objects that will be added to the plot. It also sets secondary color: This is the color of the line for CONNECTED_CIRCLES, and the color for filling open symbols (CIRCLE, BOX, TRIANGLE). Set it to null or use the one-argument call setColor(color) to disable filling. For selecting the color of the curve passed with the constructor, usesetColor
beforedraw
. The frame and labels are always drawn in black. -
setColor
Sets the drawing colors for the next objects that will be added to the plot. -
setBackgroundColor
Set the plot frame background color. -
setBackgroundColor
Set the plot frame background color. -
setLineWidth
public void setLineWidth(int lineWidth) Changes the line width for the next objects that will be added to the plot. -
setLineWidth
public void setLineWidth(float lineWidth) Changes the line width for the next objects that will be added to the plot. After all objects have been added, set the line width to the width desired for the frame around the plot (max. 3) -
drawLine
public void drawLine(double x1, double y1, double x2, double y2) Draws a line using the coordinate system defined by setLimits(). -
drawNormalizedLine
public void drawNormalizedLine(double x1, double y1, double x2, double y2) Draws a line using a normalized 0-1, 0-1 coordinate system, with (0,0) at the top left and (1,1) at the lower right corner. This is the same coordinate system used by addLabel(x,y,label). -
drawDottedLine
public void drawDottedLine(double x1, double y1, double x2, double y2, int step) Draws a line using the coordinate system defined by setLimits(). -
setFontSize
public void setFontSize(int size) Sets the font size for all following addLabel() etc. operations. The currently set font when displaying the plot determines the font of all labels & numbers. After the plot has been shown, sets the font for the numbers and the legend (if present). If the plot is hown already, call update() thereafter to make the change visible. -
setFont
Sets the font for all following addLabel() etc. operations. The currently set font when displaying the plot determines the font of all labels & numbers. After the plot has been shown, sets the font for the numbers and the legend (if present); use setFont(char, Font) to set these fonts individually. If the plot is hown already, call update() thereafter to make the change visible. -
setFont
public void setFont(int style, float size) Sets the font size and style for all following addLabel() etc. operations. This leaves the font name and style of the previously used fonts unchanged. The currently set font when displaying the plot determines the font of the numbers at the axes. That font also sets the default label font size, which may be overridden by setAxisLabelFontSize or setXLabelFont, setYLabelFont. After the plot has been shown, sets the font for the numbers and the legend (if present); use setFont(char, Font) to set these fonts individually. Styles are defined in the Font class, e.g. Font.PLAIN, Font.BOLD. Setstyle
to -1 to leave the style unchanged. Call update() thereafter to make the change visible (if the image is shown already). -
setAxisLabelFont
public void setAxisLabelFont(int style, float size) Sets the x and y label font size and style. Styles are defined in the Font class, e.g. Font.PLAIN, Font.BOLD. Setstyle
to -1 to leave the style unchanged. Call update() thereafter to make the change visible (if the image is shown already). -
setXLabelFont
Sets the xLabelFont; must not be null. If this method is not used, the last setFont of setFontSize call before displaying the plot determines the font, or if neither was called, the font size of the Plot Options is used. -
setYLabelFont
Sets the yLabelFont; must not be null. -
setAntialiasedText
public void setAntialiasedText(boolean antialiasedText) Determines whether to use antialiased text (default true) -
getCurrentFont
Returns the font currently used (e.g. for the next 'addLabel') -
getDefaultFont
Returns the default font for the plot -
getFont
Gets the font for xLabel ('x'), yLabel('y'), numbers ('f' for 'frame') or the legend ('l'). Returns null if the given PlotObject does not exist or its font is null -
setFont
Sets the font for xLabel ('x'), yLabel('y'), numbers ('f' for 'frame') or the legend ('l') -
getLabel
Gets the label String of the xLabel ('x'), yLabel('y') or the legend ('l'). Returns null if the given PlotObject does not exist or its label is null -
getObjectFlags
public int getObjectFlags(char c) Gets the flags of the xLabel ('x'), yLabel('y') or the legend ('l'). Returns -1 if the given PlotObject does not exist -
getXValues
public float[] getXValues()Get the x coordinates of the data set passed with the constructor (if not null) or otherwise of the data set of the first 'addPoints'. Returns null if neither exists -
getYValues
public float[] getYValues()Get the y coordinates of the data set passed with the constructor (if not null) or otherwise of the data set of the first 'addPoints'. Returns null if neither exists -
getDataObjectArrays
public float[][] getDataObjectArrays(int index) Get the data of the n-th Plot Object containing xy data in the sequence they were added (Other Plot Objects such as labels, arrows, lines, shapes and hidden PlotObjects are not counted). The array returned has elements [0] x data, [1] y data, [2] x error bars, [3] y error bars. If no error bars are given, the corresponding arrays are null. Returns null if there is no Plot Object with xy data with this index.- See Also:
-
getPlotObjectDesignations
Gets an array with human-readable designations of the PlotObjects (curves, labels, ...) in the sequence they were added (the object passed with the constructor is first, even though it is plotted last). Hidden PlotObjects are included. -
getDataObjectDesignations
Gets an array with human-readable designations of the PlotObjects containing xy data in the sequence they were added. Other Plot Objects such as labels, arrows, lines, shapes and hidden PlotObjects are not counted. (the object passed with the constructor is first, even though it is plotted last). -
getNumPlotObjects
public int getNumPlotObjects()Returns the number of PlotObjects (curves, labels, ...) passed with the constructor or added by 'add' or 'draw' methods. Legend, frame and axes (though internally PlotObjects) are not included -
addObjectFromPlot
Add the i-th PlotObject (in the sequence how they were added, including hidden ones) from another plot to this one. PlotObjects here refers to curves, arrows, labels etc. (not legend, axes and frame, though implemented as PlotObjects) Use 'update' to update the plot thereafter.- Returns:
- Index of the plotObject added in the sequence they were added
-
getPlotObjectStyle
Get the style of the i-th PlotObject (curve, label, ...) in the sequence they were added (including hidden ones), as String with comma delimiters: Main Color, Secondary Color (or "none"), Line Width [, Symbol shape for XY_DATA] [,hidden] PlotObjects here refers to curves, arrows, labels etc. (not legend, exes and frame, though implemented as PlotObjects) -
getPlotObjectLabel
Get the label the i-th PlotObject (in the sequence how they were added, including hidden ones). Returns null if no label. PlotObjects here refers to curves, arrows, labels etc. (not legend, exes and frame, though implemented as PlotObjects) -
setPlotObjectLabel
Set the label the i-th PlotObject (in the sequence how they were added, including hidden ones) PlotObjects here refers to curves, arrows, labels etc. (not legend, exes and frame, though implemented as PlotObjects) -
setStyle
Sets the style of the specified PlotObject (curve, label, etc.) from a comma-delimited string ("color1,color2,lineWidth[,symbol][,hidden]"), where "color2" can be "none" and "symbol" and "hidden" are optional. PlotObjects here refers to curves, arrows, labels etc. (not legend, exes and frame, though implemented as PlotObjects) -
setPlotObjectStyle
-
getPlotObjectIndex
public int getPlotObjectIndex(float[][] values) Returns the index of the first plot object with x,y data (points, line) or arrows with all data equal to those given. Returns or -1 is no such plot object exists. The array 'values' should contain the x, y, x error bar, yerror bar data. The 'values' array may have any size; only the data given are compared (e.g. for an array with length 2, there is no check for erro bars). Used when adding data from a table not to suggest the same data twice. -
savePlotObjects
public void savePlotObjects()Creates a snapshot of the plot contents (not including axis formats etc), for later undo by restorePlotObjects. See also killPlotObjectsSnapshot -
restorePlotObjects
public void restorePlotObjects()Restores the plot contents (not including axis formats etc) from the snapshot previously created by savePlotObjects(). See also killPlotObjectsSnapshot Use 'update' to update the plot thereafter. -
killPlotObjectsSnapshot
public void killPlotObjectsSnapshot()Deletes the snapshot of the plot contents to make space -
savePlotPlotProperties
public void savePlotPlotProperties()Creates a snapshot of the plot properties (formatting, range etc., not PlotObjects such as data and corresponding curves etc.), for later undo by restorePlotProperties. See also killPlotPropertiesSnapshot -
restorePlotProperties
public void restorePlotProperties()Restores the plot properties (formatting, range etc., not PlotObjects such as data and corresponding curves etc.) from a snapshot previously created by savePlotPlotProperties. See also killPlotPropertiesSnapshot. Use 'update' to update the plot thereafter. -
killPlotPropertiesSnapshot
public void killPlotPropertiesSnapshot()Deletes the snapshot of the plot properties to make space -
setLimitsToDefaults
public void setLimitsToDefaults(boolean updateImg) Sets the plot range to the initial value determined from minima&maxima or given by setLimits. Updates the image if existing and updateImg is true -
setLimitsToFit
public void setLimitsToFit(boolean updateImg) Sets the plot range to encompass all data. Updates the image if existing and updateImg is true. -
setPreviousMinMax
public void setPreviousMinMax()reverts plot range to previous values and updates the image -
getProcessor
Draws the plot (if not done before) in an ImageProcessor and returns the ImageProcessor with the plot. -
getImagePlus
Returns the plot as an ImagePlus. If an ImagePlus for this plot already exists, displays the plot in that ImagePlus and returns it. -
setImagePlus
Sets the ImagePlus where the plot will be displayed. If the ImagePlus is not known otherwise (e.g. from getImagePlus), this is needed for changes such as zooming in to work correctly. It also sets the calibration of the ImagePlus. The ImagePlus is not displayed or updated unless its ImageProcessor is no that of the current Plot (then it gets this ImageProcessor). Does nothing if imp is unchanged and has the ImageProcessor of this plot. 'imp' may be null to disconnect the plot from its ImagePlus. Does nothing for Plot Stacks. -
adjustCalibration
Adjusts a Calibration object to fit the current axes. For log axes, the calibration refers to the base-10 logarithm of the value -
show
Displays the plot in a PlotWindow. Plot stacks are shown in a StackWindow, not in a PlotWindow; in this case the return value is null (use getImagePlus().getWindow() instead). Also returns null in BatchMode. Note that the PlotWindow might get closed immediately if its 'listValues' and 'autoClose' flags are set.- See Also:
-
addToStack
public void addToStack()Appends the current plot to a virtual stack and resets allPlotObjects for next slice N. Vischer -
appendToStack
public void appendToStack() -
getStack
Returns the virtual stack created by addToStack(). -
draw
public void draw()Draws the plot specified for the first time. Does nothing if the plot has been drawn already. Call getProcessor to retrieve the ImageProcessor with it. Does no action with respect to the ImagePlus (if any) -
setFrozen
public void setFrozen(boolean frozen) Freezes or unfreezes the plot. In the frozen state, the plot cannot be resized or updated, and the Plot class does no modifications to the ImageProcessor. Changes are recorded nevertheless and become effective withsetFrozen(false)
. -
isFrozen
public boolean isFrozen() -
update
public void update()Draws the plot again, ignored if the plot has not been drawn before or the plot is frozen. -
updateImage
public void updateImage()Draws the plot again, ignored if the plot has not been drawn before or the plot is frozen. If the ImagePlus exist, updates it and its calibration. -
getDrawingFrame
Returns the rectangle where the data are plotted. This rectangle includes the black outline frame at the top and left, but not at the bottom and right (when the frame is plotted with 1 pxl width). The image scale is its width or height in pixels divided by the data range in x or y. -
makeHighResolution
public ImagePlus makeHighResolution(String title, float scale, boolean antialiasedText, boolean showIt) Creates a new high-resolution plot by scaling it and displays that plot if showIt is true.title
may be null, then a default title is used. -
dispose
public void dispose()Releases the ImageProcessor and ImagePlus associated with the plot. May help garbage collection because some garbage collectors are said to be inefficient with circular references. -
descaleX
public double descaleX(int x) Converts pixels to calibrated coordinates. In contrast to the image calibration, also works with log axes and inverted x axes -
descaleY
public double descaleY(int y) Converts pixels to calibrated coordinates. In contrast to the image calibration, also works with log axes -
scaleXtoPxl
public double scaleXtoPxl(double x) Converts calibrated coordinates to pixel coordinates. In contrast to the image calibration, also works with log x axis and inverted x axis -
scaleYtoPxl
public double scaleYtoPxl(double y) Converts calibrated coordinates to pixel coordinates. In contrast to the image calibration, also works with log y axis -
redrawGrid
public void redrawGrid() -
drawArrow
Deprecated.Use as a public method is not supported any more because it is incompatible with rescalingAdds an arrow from position 1 to 2 given in pixels; 'size' is the length of the arrowhead -
setPlotMaker
-
getResultsTable
Creates a ResultsTable with the plot data. Returns an empty table if no data. -
getResultsTable
Creates a ResultsTable with the data of the plot. Returns null if no data. Does not write the first x column if writeFirstXColumn is false. When all columns are the same length, x columns equal to the first x column are not written, independent of writeFirstXColumn. Column headings are "X", "Y", "X1", "Y1", etc, irrespective of any labels of the data sets -
getResultsTableWithLabels
Creates a ResultsTable with the data of the plot. Returns null if no data. When all columns are the same length, x columns equal to the first x column are not written, independent of writeFirstXColumn. When the data sets have labels, they are used for column headings -
addPoints
-
addHistogram
public void addHistogram(double[] values) Plots a histogram from an array using auto-binning.- Parameters:
values
- array containing the population N.Vischer
-
addHistogram
public void addHistogram(double[] values, double binWidth) Plots a histogram from an array using the specified bin width.- Parameters:
values
- array containing the populationbinWidth
- set zero for auto-binning N.Vischer
-
addHistogram
public void addHistogram(double[] values, double binWidth, double binCenter) Plots a histogram of the value distribution (bin counts) from an array- Parameters:
values
- array containing the values for the populationbinWidth
- set zero for auto-binningbinCenter
- any x value can be the center of a bin N.Vischer
-
addErrorBars
-
changeFont
-