Documentation of 'edu.rit.numeric.plot.impl.XYPlot' Java class
XYPlot
edu.rit.numeric.plot.impl

Class XYPlot

  • All Implemented Interfaces:
    Displayable, Drawable


    public class XYPlot
    extends java.lang.Object
    implements Displayable
    Class XYPlot provides an XY plot. The plot has an X axis, a Y axis, and one or more plot series (type PlotSeries). The plot may optionally have a Grid. Labels (class Label) may be added to a plot and are drawn after drawing all the plot series.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.awt.Paint DEFAULT_BACKGROUND
      The default background paint (white).
      static double DEFAULT_MARGIN
      The default margin (54).
    • Constructor Summary

      Constructors 
      Constructor and Description
      XYPlot(NumericalAxis theXAxis, NumericalAxis theYAxis)
      Construct a new XY plot with the given axes.
      XYPlot(NumericalAxis theXAxis, NumericalAxis theYAxis, Grid theGrid)
      Construct a new XY plot with the given axes and grid.
      XYPlot(NumericalAxis theXAxis, NumericalAxis theYAxis, Grid theGrid, double theMargin)
      Construct a new XY plot with the given axes, grid, and margin.
      XYPlot(NumericalAxis theXAxis, NumericalAxis theYAxis, Grid theGrid, double theLeftMargin, double theTopMargin, double theRightMargin, double theBottomMargin)
      Construct a new XY plot with the given axes, grid, and margins.
      XYPlot(NumericalAxis theXAxis, NumericalAxis theYAxis, Grid theGrid, double theLeftMargin, double theTopMargin, double theRightMargin, double theBottomMargin, java.awt.Paint theBackgroundPaint)
      Construct a new XY plot with the given axes, grid, margins, and background.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addLabel(Label theLabel)
      Add the given label to this XY plot.
      void addPlotSeries(PlotSeries thePlotSeries)
      Add the given plot series to this XY plot.
      void draw(java.awt.Graphics2D g2d)
      Draw this drawable object in the given graphics context.
      java.awt.Paint getBackgroundPaint()
      Returns this displayable object's background paint.
      java.awt.geom.Rectangle2D getBoundingBox()
      Returns this displayable object's bounding box.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_MARGIN

        public static final double DEFAULT_MARGIN
        The default margin (54).
        See Also:
        Constant Field Values
      • DEFAULT_BACKGROUND

        public static final java.awt.Paint DEFAULT_BACKGROUND
        The default background paint (white).
    • Constructor Detail

      • XYPlot

        public XYPlot(NumericalAxis theXAxis,
                      NumericalAxis theYAxis)
        Construct a new XY plot with the given axes. The plot has no grid. The plot uses the default margin (54) on all sides. The plot uses the default background (white).
        Parameters:
        theXAxis - X axis.
        theYAxis - Y axis.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theXAxis is null or theYAxis is null.
      • XYPlot

        public XYPlot(NumericalAxis theXAxis,
                      NumericalAxis theYAxis,
                      Grid theGrid)
        Construct a new XY plot with the given axes and grid. The plot uses the default margin (54) on all sides. The plot uses the default background (white).
        Parameters:
        theXAxis - X axis.
        theYAxis - Y axis.
        theGrid - Grid, or null for no grid.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theXAxis is null or theYAxis is null.
      • XYPlot

        public XYPlot(NumericalAxis theXAxis,
                      NumericalAxis theYAxis,
                      Grid theGrid,
                      double theMargin)
        Construct a new XY plot with the given axes, grid, and margin. The plot uses the same margin on all sides. The plot uses the default background (white).
        Parameters:
        theXAxis - X axis.
        theYAxis - Y axis.
        theGrid - Grid, or null for no grid.
        theMargin - Margin.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theXAxis is null or theYAxis is null.
        java.lang.IllegalArgumentException - (unchecked exception) Thrown if theMargin is less than 0.
      • XYPlot

        public XYPlot(NumericalAxis theXAxis,
                      NumericalAxis theYAxis,
                      Grid theGrid,
                      double theLeftMargin,
                      double theTopMargin,
                      double theRightMargin,
                      double theBottomMargin)
        Construct a new XY plot with the given axes, grid, and margins. The plot uses the default background (white).
        Parameters:
        theXAxis - X axis.
        theYAxis - Y axis.
        theGrid - Grid, or null for no grid.
        theLeftMargin - Left margin.
        theTopMargin - Top margin.
        theRightMargin - Right margin.
        theBottomMargin - Left margin.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theXAxis is null or theYAxis is null.
        java.lang.IllegalArgumentException - (unchecked exception) Thrown if any margin is less than 0.
      • XYPlot

        public XYPlot(NumericalAxis theXAxis,
                      NumericalAxis theYAxis,
                      Grid theGrid,
                      double theLeftMargin,
                      double theTopMargin,
                      double theRightMargin,
                      double theBottomMargin,
                      java.awt.Paint theBackgroundPaint)
        Construct a new XY plot with the given axes, grid, margins, and background.
        Parameters:
        theXAxis - X axis.
        theYAxis - Y axis.
        theGrid - Grid, or null for no grid.
        theLeftMargin - Left margin.
        theTopMargin - Top margin.
        theRightMargin - Right margin.
        theBottomMargin - Left margin.
        theBackgroundPaint - Background paint.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theXAxis is null, theYAxis is null, or theBackgroundPaint is null.
        java.lang.IllegalArgumentException - (unchecked exception) Thrown if any margin is less than 0.
    • Method Detail

      • addPlotSeries

        public void addPlotSeries(PlotSeries thePlotSeries)
        Add the given plot series to this XY plot. When this XY plot is drawn, the plot series are drawn in the order they were added; that is, last added plot series on top.
        Parameters:
        thePlotSeries - Plot series.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if thePlotSeries is null.
      • addLabel

        public void addLabel(Label theLabel)
        Add the given label to this XY plot. When this XY plot is drawn, the labels are drawn after the plot series, and the labels are drawn in the order they were added; that is, last added label on top.
        Parameters:
        theLabel - Label.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theLabel is null.
      • draw

        public void draw(java.awt.Graphics2D g2d)
        Draw this drawable object in the given graphics context. Upon return from this method, the given graphics context's state (color, font, transform, clip, and so on) is the same as it was upon entry to this method.

        This XY plot is drawn so that the upper left corner (including the margins) is located at the display coordinates (0, 0) in the graphics context.

        Specified by:
        draw in interface Drawable
        Parameters:
        g2d - 2-D graphics context.
      • getBoundingBox

        public java.awt.geom.Rectangle2D getBoundingBox()
        Returns this displayable object's bounding box. This is the smallest rectangle that encloses all of this displayable object.
        Specified by:
        getBoundingBox in interface Displayable
      • getBackgroundPaint

        public java.awt.Paint getBackgroundPaint()
        Returns this displayable object's background paint.
        Specified by:
        getBackgroundPaint in interface Displayable

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.