BasicPlotteris to provide a small fraction of the functionality known from "R" or "GnuPlot", if you have some basic elements, such as lines, ellipses, rectangles, you want to add to your view you can use the
This class is a specialization of the
A drawing element consists of points which are already mapped to the drawing pane's dimension.
Represents an ellipse defined by two points, the lower-left and the upper-right corner, different from normal Java graphics behavior!
Represents a line by a list of points which are connected to one line.
Tha BasicPlotter provides means to add some simple, basic graphical forms to the drawing pane, which are automatically mapped to the drawing pane's dimension.
Represents a rectangle which is defined by two points, the upper-left and the lower-right corner as known from Java Graphics.
Represents a textline, the startpoint has to be set with the
The idea behind the
BasicPlotter is to provide a small fraction of the
functionality known from "R" or "GnuPlot", if you have some basic elements,
such as lines, ellipses, rectangles, you want to add to your view you can use
addLine(double yValues, Color color, Stroke stroke) addLine(double xValues, double yValues, Color color, Stroke stroke) addRectangle(double x, double y, int width, int height, Color color, Stroke stroke, boolean filled) addEllipse(double xCenter, double yCenter, double width, double height, Color color, Stroke stroke, boolean filled)The usage of the
BasicPlottermethods only makes sense, if the the domain values of the elements are known but not the mapped values. One example is a scatter plot where you want to add a regression line. Here only the domain values of the line are known and can simply be added as a line to the plotter with the domain values. The
BasicPlotterwill map the domain values to the drawing pane's size. If you set
preserve = truein the
AbstractPlotterthe existing ranges of the coordinates won't be adapted. If you set preserve to false, the ranges will be adapted if, for example, the added rectangle is larger than the existing range of the coordinates. Another possibility is to add a
DataArraywhich will be visualized with a line connecting all values in the columns, where the row number is the x axis and the value of the column is painted at the y axis.
addLine(DataArray data, int columnIndex, Color color, Stroke stroke)If you want to add a specific element to the
BasicPlotteryou can extend the
Basic2DDrawingElement(described below) with
BasicDrawingElementconsists of a number of domain values and the referring mapped points, a color and a stroke. Whenever the size is changed, the
BasicPlottertakes the domain values and maps them to the current drawing pane size. How the
BasicDrawingElementis actually painted (depending on the given points) is defined in the paint method which is abstract. The
BasicDrawingElementby holding a flag, whether the form should be filled or not. Thus, if you want to add, for example, a triangle you have to extend the
Basic2DDrawingElementthen assert that the given points are the left corner, the top and the right corner and define the paint method to connect the points or fill the shape.
BasicDrawingPane, get them and clear the
BasicDrawingElementswith the following methods:
addDrawingElement(BasicDrawingElement element) getDrawingElements() clearPlot()
KNIME GmbH, Konstanz, Germany
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.