Documentation of 'de.erichseifert.gral.plots.BoxPlot' Java class
BoxPlot
de.erichseifert.gral.plots

Class BoxPlot

  • All Implemented Interfaces:
    DataListener, Container, Drawable, Navigable, AxisListener, Plot, java.io.Serializable, java.lang.Iterable<Drawable>


    public class BoxPlot
    extends XYPlot

    Class that displays data as a box-and-whisker plot showing summaries of important statistical values. The data source must provide six columns to the BoxPlot:

    • Box position (for multiple boxes)
    • Position of the center bar (e.g. median)
    • Length of the lower whisker and position of the bottom bar (e.g. minimum)
    • Position of the bottom edge of the box (e.g. first quartile)
    • Position of the top edge of the box (e.g. third quartile)
    • Length of the upper whisker and position of the top bar (e.g. maximum)

    The utility method createBoxData(DataSource) can be used to obtain common statistics for these properties from the each column of an existing data source.

    To create a new BoxPlot simply create a new instance using a data source. Example:

     DataTable data = new DataTable(Double.class, Double.class);
     data.add(10.98, -12.34);
     data.add( 7.65,  45.67);
     data.add(43.21,  89.01);
     DataSource boxData = BoxPlot.createBoxData(data);
     BoxPlot plot = new BoxPlot(boxData);
     
    See Also:
    Serialized Form
    • Constructor Detail

      • BoxPlot

        public BoxPlot(DataSource data)
        Initializes a new box-and-whisker plot with the specified data source.
        Parameters:
        data - Data to be displayed.
    • Method Detail

      • createBoxData

        public static DataSource createBoxData(DataSource data)
        Extracts statistics from the columns of an data source that are commonly used for box-and-whisker plots. The result is a new data source containing column index, median, mininum, first quartile, third quartile, and maximum for each column.
        Parameters:
        data - Original data source
        Returns:
        New data source with (columnIndex, median, min, quartile1, quartile3, max)
      • add

        public void add(int index,
                        DataSource source,
                        boolean visible)
        Description copied from class: AbstractPlot
        Inserts the specified data series to the plot at a specified position.
        Specified by:
        add in interface Plot
        Overrides:
        add in class XYPlot
        Parameters:
        index - Position.
        source - Data series.
        visible - true if the series should be displayed, false otherwise.
      • autoscaleAxis

        public void autoscaleAxis(java.lang.String axisName)
        Description copied from class: AbstractPlot
        Tries to automatically set the ranges of the axes specified by the name if it is set to auto-scale.
        Specified by:
        autoscaleAxis in interface Plot
        Overrides:
        autoscaleAxis in class AbstractPlot
        Parameters:
        axisName - Name of the axis that should be scaled.
        See Also:
        Axis.setAutoscaled(boolean)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.