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

Class RasterPlot

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


    public class RasterPlot
    extends XYPlot

    Class that displays two coordinate values and a value as a raster of boxes. The data source must provide at least three columns:

    • x coordinate
    • y coordinate
    • value

    The method createRasterData(DataSource) can be used to convert a matrix of values to the (coordinates, value) format.

    To create a new RasterPlot simply create a new instance using a suitable 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 rasterData = RasterPlot.createRasterData(data);
     RasterPlot plot = new RasterPlot(rasterData);
     
    See Also:
    Serialized Form
    • Constructor Detail

      • RasterPlot

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

      • 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)
      • createRasterData

        public static DataSource createRasterData(DataSource data)
        Takes a matrix of values and creates a new data source that stores the values in (x, y, value) format.
        Parameters:
        data - Original data source with values in each cell.
        Returns:
        New data source with (x, y, value) columns
      • 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.
      • getOffset

        public java.awt.geom.Point2D getOffset()
        Returns the horizontal and vertical offset of the raster from the origin.
        Returns:
        Horizontal and vertical offset of the raster from the origin.
      • setOffset

        public void setOffset(java.awt.geom.Point2D offset)
        Sets the horizontal and vertical offset of the raster from the origin.
        Parameters:
        offset - Horizontal and vertical offset of the raster from the origin.
      • getDistance

        public java.awt.geom.Dimension2D getDistance()
        Returns the horizontal and vertical distance of the raster elements.
        Returns:
        Horizontal and vertical distance of the raster elements.
      • setDistance

        public void setDistance(java.awt.geom.Dimension2D distance)
        Returns the horizontal and vertical distance of the raster elements.
        Parameters:
        distance - Horizontal and vertical distance of the raster elements.
      • getColors

        public ColorMapper getColors()
        Returns the object which is used to map pixel values to colors.
        Returns:
        Object which is used to map pixel values to colors.
      • setColors

        public void setColors(ColorMapper colors)
        Sets the object which will be used to map pixel values to colors.
        Parameters:
        colors - Object which will be used to map pixel values to colors.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.