Class XYPlot


  • public class XYPlot
    extends Plot
    Implements an XYPlot.
    • Constructor Detail

      • XYPlot

        public XYPlot​(String[] values,
                      String xLabel,
                      String yLabel)
        Creates a new XYPlot
        Parameters:
        values - Point labels values
        xLabel - Label of the x axis
        yLabel - Label of the y axis
      • XYPlot

        public XYPlot​(String[] values,
                      String xLabel,
                      String yLabel,
                      boolean hideLegend)
        Creates a new XYPlot
        Parameters:
        values - Point labels values
        xLabel - Label of the x axis
        yLabel - Label of the y axis
        hideLegend - Indicates if the legend must be hidden. False by default.
    • Method Detail

      • addSeries

        public XYPlot addSeries​(String seriesName)
        Adds a new empty series to the plot. Points are initialized to x=0 and y=0 all point labels.
        Parameters:
        seriesName - Series name
        Returns:
        Self XYPlot instance
      • addSeries

        public XYPlot addSeries​(String seriesName,
                                double x,
                                double y)
        Adds a new series to the plot initializing x and y to a constant one for all point labels.
        Parameters:
        seriesName - Series name
        x - x initialization
        y - y initialization
        Returns:
        Self XYPlot instance
      • addSeries

        public XYPlot addSeries​(String seriesName,
                                double[] xs,
                                double[] ys)
        Adds a new series to the plot. xs and ys positions must be correlated with point labels.
        Parameters:
        seriesName - Series name
        xs - x values
        ys - y values
        Returns:
        Self XYPlot instance
      • setXY

        public XYPlot setXY​(String seriesName,
                            String label,
                            double x,
                            double y)
        Sets a single point of a series
        Parameters:
        seriesName - Series name
        label - Label value of the point. Must exists
        x - x value
        y - y value
        Returns:
        Self XYPlot instance
      • setLabelsVisible

        public XYPlot setLabelsVisible​(String seriesName)
        Set the labels visible for a series
        Parameters:
        seriesName - Series name
        Returns:
        Self XYPlot instance
      • setLabelsNotVisible

        public XYPlot setLabelsNotVisible​(String seriesName)
        Set the labels not visible for a series
        Parameters:
        seriesName - Series name
        Returns:
        Self XYPlot instance
      • getDataHeaders

        protected String[] getDataHeaders()
        Description copied from class: Plot
        Returns an String array with the headers of the plot's data
        Specified by:
        getDataHeaders in class Plot
        Returns:
        Headers of the plot's data
      • getDataContent

        protected String[][] getDataContent​(String xAxisTicksFormat,
                                            String yAxisTicksFormat)
        Description copied from class: Plot
        Returns an String matrix with the content of the plot's data. First dimension denotes the row and second dimension denotes the column that must be correlated with the header returned by getDataHeaders().
        Specified by:
        getDataContent in class Plot
        Parameters:
        xAxisTicksFormat - Number format for the values of the x axis
        yAxisTicksFormat - Number format for the values of the x axis
        Returns:
        String matrix with the content of the plot's data
      • getGralPlot

        protected de.erichseifert.gral.plots.AbstractPlot getGralPlot()
        Description copied from class: Plot
        Gets an AbstractPlot using GRAL
        Specified by:
        getGralPlot in class Plot
        Returns:
        GRAL's AbstractPlot