smile.plot.swing

Swing based data visualization.

Attributes

Members list

Type members

Classlikes

case class CanvasWindow(frame: JFrame, canvas: Canvas) extends JWindow

Plot canvas window.

Plot canvas window.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait JWindow
class Object
trait Matchable
class Any
Show all
object Html

HTML <img> tag of Canvas and JComponent.

HTML <img> tag of Canvas and JComponent.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Html.type
trait JWindow

JFrame window.

JFrame window.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object JWindow

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
JWindow.type
case class PlotGridWindow(frame: JFrame, canvas: PlotGrid) extends JWindow

Plot grid window.

Plot grid window.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait JWindow
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def boxplot(data: Array[Double]*): Canvas

A box plot is a convenient way of graphically depicting groups of numerical data through their five-number summaries (the smallest observation (sample minimum), lower quartile (Q1), median (Q2), upper quartile (Q3), and largest observation (sample maximum). A box plot may also indicate which observations, if any, might be considered outliers.

A box plot is a convenient way of graphically depicting groups of numerical data through their five-number summaries (the smallest observation (sample minimum), lower quartile (Q1), median (Q2), upper quartile (Q3), and largest observation (sample maximum). A box plot may also indicate which observations, if any, might be considered outliers.

Box plots can be useful to display differences between populations without making any assumptions of the underlying statistical distribution: they are non-parametric. The spacings between the different parts of the box help indicate the degree of dispersion (spread) and skewness in the data, and identify outliers.

For a data set, we construct a boxplot in the following manner:

  • Calculate the first q1, the median q2 and third quartile q3.
  • Calculate the interquartile range (IQR) by subtracting the first quartile from the third quartile. (q3 ? q1)
  • Construct a box above the number line bounded on the bottom by the first quartile (q1) and on the top by the third quartile (q3).
  • Indicate where the median lies inside the box with the presence of a line dividing the box at the median value.
  • Any data observation which lies more than 1.5*IQR lower than the first quartile or 1.5IQR higher than the third quartile is considered an outlier. Indicate where the smallest value that is not an outlier is by connecting it to the box with a horizontal line or "whisker". Optionally, also mark the position of this value more clearly using a small vertical line. Likewise, connect the largest value that is not an outlier to the box by a "whisker" (and optionally mark it with another small vertical line).
  • Indicate outliers by dots.

Value parameters

data

a data matrix of which each row will create a box plot.

Attributes

Returns

the plot canvas which can be added other shapes.

def boxplot(data: Array[Array[Double]], labels: Array[String]): Canvas

Box plot.

Box plot.

Value parameters

data

a data matrix of which each row will create a box plot.

labels

the labels for each box plot.

Attributes

Returns

the plot canvas which can be added other shapes.

def contour(z: Array[Array[Double]]): Canvas

Contour plot. A contour plot is a graphical technique for representing a 3-dimensional surface by plotting constant z slices, called contours, on a 2-dimensional format. That is, given a value for z, lines are drawn for connecting the (x, y) coordinates where that z value occurs. The contour plot is an alternative to a 3-D surface plot.

Contour plot. A contour plot is a graphical technique for representing a 3-dimensional surface by plotting constant z slices, called contours, on a 2-dimensional format. That is, given a value for z, lines are drawn for connecting the (x, y) coordinates where that z value occurs. The contour plot is an alternative to a 3-D surface plot.

Value parameters

z

the data matrix to create contour plot.

Attributes

Returns

the plot canvas which can be added other shapes.

def contour(z: Array[Array[Double]], levels: Array[Double]): Canvas

Contour plot. A contour plot is a graphical technique for representing a 3-dimensional surface by plotting constant z slices, called contours, on a 2-dimensional format. That is, given a value for z, lines are drawn for connecting the (x, y) coordinates where that z value occurs. The contour plot is an alternative to a 3-D surface plot.

Contour plot. A contour plot is a graphical technique for representing a 3-dimensional surface by plotting constant z slices, called contours, on a 2-dimensional format. That is, given a value for z, lines are drawn for connecting the (x, y) coordinates where that z value occurs. The contour plot is an alternative to a 3-D surface plot.

Value parameters

levels

the level values of contours.

z

the data matrix to create contour plot.

Attributes

Returns

the plot canvas which can be added other shapes.

def contour(x: Array[Double], y: Array[Double], z: Array[Array[Double]]): Canvas

Contour plot. A contour plot is a graphical technique for representing a 3-dimensional surface by plotting constant z slices, called contours, on a 2-dimensional format. That is, given a value for z, lines are drawn for connecting the (x, y) coordinates where that z value occurs. The contour plot is an alternative to a 3-D surface plot.

Contour plot. A contour plot is a graphical technique for representing a 3-dimensional surface by plotting constant z slices, called contours, on a 2-dimensional format. That is, given a value for z, lines are drawn for connecting the (x, y) coordinates where that z value occurs. The contour plot is an alternative to a 3-D surface plot.

Value parameters

x

the x coordinates of the data grid of z. Must be in ascending order.

y

the y coordinates of the data grid of z. Must be in ascending order.

z

the data matrix to create contour plot.

Attributes

Returns

the plot canvas which can be added other shapes.

def dendrogram(hc: HierarchicalClustering): Canvas

A dendrogram is a tree diagram to illustrate the arrangement of the clusters produced by hierarchical clustering.

A dendrogram is a tree diagram to illustrate the arrangement of the clusters produced by hierarchical clustering.

Value parameters

hc

hierarchical clustering object.

Attributes

def dendrogram(merge: Array[Array[Int]], height: Array[Double]): Canvas

A dendrogram is a tree diagram to illustrate the arrangement of the clusters produced by hierarchical clustering.

A dendrogram is a tree diagram to illustrate the arrangement of the clusters produced by hierarchical clustering.

Value parameters

height

a set of n-1 non-decreasing real values, which are the clustering height, i.e., the value of the criterion associated with the clustering method for the particular agglomeration.

merge

an n-1 by 2 matrix of which row i describes the merging of clusters at step i of the clustering. If an element j in the row is less than n, then observation j was merged at this stage. If j ≥ n then the merge was with the cluster formed at the (earlier) stage j-n of the algorithm.

Attributes

def grid(data: Array[Array[Array[Double]]]): Canvas

2D grid plot.

2D grid plot.

Value parameters

data

an m x n x 2 array which are coordinates of m x n grid.

Attributes

def heatmap(z: Array[Array[Double]], palette: Array[Color]): Canvas

Pseudo heat map plot.

Pseudo heat map plot.

Value parameters

palette

the color palette.

z

a data matrix to be shown in pseudo heat map.

Attributes

def heatmap(x: Array[Double], y: Array[Double], z: Array[Array[Double]], palette: Array[Color]): Canvas

Pseudo heat map plot.

Pseudo heat map plot.

Value parameters

palette

the color palette.

x

x coordinate of data matrix cells. Must be in ascending order.

y

y coordinate of data matrix cells. Must be in ascending order.

z

a data matrix to be shown in pseudo heat map.

Attributes

def heatmap(rowLabels: Array[String], columnLabels: Array[String], z: Array[Array[Double]], palette: Array[Color]): Canvas

Pseudo heat map plot.

Pseudo heat map plot.

Value parameters

columnLabels

the labels for columns of data matrix.

palette

the color palette.

rowLabels

the labels for rows of data matrix.

z

a data matrix to be shown in pseudo heat map.

Attributes

def hexmap(z: Array[Array[Double]], palette: Array[Color]): Canvas

Heat map with hex shape.

Heat map with hex shape.

Value parameters

palette

the color palette.

z

a data matrix to be shown in pseudo heat map.

Attributes

def hist(data: Array[Double], k: Int, prob: Boolean, color: Color): Canvas

Histogram plot.

Histogram plot.

Value parameters

data

a sample set.

k

the number of bins.

Attributes

def hist(data: Array[Double], breaks: Array[Double], prob: Boolean, color: Color): Canvas

Histogram plot.

Histogram plot.

Value parameters

breaks

an array of size k+1 giving the breakpoints between histogram cells. Must be in ascending order.

data

a sample set.

Attributes

def hist3(data: Array[Array[Double]], xbins: Int, ybins: Int, prob: Boolean, palette: Array[Color]): Canvas

3D histogram plot.

3D histogram plot.

Value parameters

data

a sample set.

xbins

the number of bins on x-axis.

ybins

the number of bins on y-axis.

Attributes

def line(data: Array[Array[Double]], style: Style, color: Color, mark: Char, label: String): Canvas

Line plot.

Line plot.

Value parameters

color

the color of line.

data

a n-by-2 or n-by-3 matrix that describes coordinates of points.

mark

the mark used to draw data points. The default value ' ' makes the point indistinguishable from the line on purpose.

style

the stroke style of line.

Attributes

Returns

the plot canvas which can be added other shapes.

def plot(x: Array[Array[Double]], mark: Char, color: Color): Canvas

Scatter plot.

Scatter plot.

Value parameters

color

the color used to draw points.

mark

the mark used to draw points. - . : dot - + : + - - : - - | : | - * : star - x : x - o : circle - O : large circle - @ : solid circle - # : large solid circle - s : square - S : large square - q : solid square - Q : large solid square - others : dot

x

a n-by-2 or n-by-3 matrix that describes coordinates of points.

Attributes

Returns

the plot canvas which can be added other shapes.

def plot(x: Array[Array[Double]], y: Array[String], mark: Char): Canvas

Scatter plot.

Scatter plot.

Value parameters

x

a n-by-2 or n-by-3 matrix that describes coordinates of points.

y

labels of points.

Attributes

Returns

the plot canvas which can be added other shapes.

def plot(x: Array[Array[Double]], y: Array[Int], mark: Char): Canvas

Scatter plot.

Scatter plot.

Value parameters

x

a n-by-2 or n-by-3 matrix that describes coordinates of points.

y

class label.

Attributes

Returns

the plot canvas which can be added other shapes.

def plot(data: DataFrame, x: String, y: String, mark: Char, color: Color): Canvas

Scatter plot.

Scatter plot.

Value parameters

data

the data frame.

x

the column as x-axis.

y

the column as y-axis.

Attributes

Returns

the plot canvas which can be added other shapes.

def plot(data: DataFrame, x: String, y: String, category: String, mark: Char): Canvas

Scatter plot.

Scatter plot.

Value parameters

category

the category column for coloring.

data

the data frame.

x

the column as x-axis.

y

the column as y-axis.

Attributes

Returns

the plot canvas which can be added other shapes.

def plot(data: DataFrame, x: String, y: String, z: String, mark: Char, color: Color): Canvas

Scatter plot.

Scatter plot.

Value parameters

data

the data frame.

x

the column as x-axis.

y

the column as y-axis.

z

the column as z-axis.

Attributes

Returns

the plot canvas which can be added other shapes.

def plot(data: DataFrame, x: String, y: String, z: String, category: String, mark: Char): Canvas

Scatter plot.

Scatter plot.

Value parameters

category

the category column for coloring.

data

the data frame.

x

the column as x-axis.

y

the column as y-axis.

z

the column as z-axis.

Attributes

Returns

the plot canvas which can be added other shapes.

def qqplot(x: Array[Double]): Canvas

QQ plot of samples to standard normal distribution. The x-axis is the quantiles of x and the y-axis is the quantiles of normal distribution.

QQ plot of samples to standard normal distribution. The x-axis is the quantiles of x and the y-axis is the quantiles of normal distribution.

Value parameters

x

a sample set.

Attributes

def qqplot(x: Array[Double], d: Distribution): Canvas

QQ plot of samples to given distribution. The x-axis is the quantiles of x and the y-axis is the quantiles of given distribution.

QQ plot of samples to given distribution. The x-axis is the quantiles of x and the y-axis is the quantiles of given distribution.

Value parameters

d

a distribution.

x

a sample set.

Attributes

def qqplot(x: Array[Double], y: Array[Double]): Canvas

QQ plot of two sample sets. The x-axis is the quantiles of x and the y-axis is the quantiles of y.

QQ plot of two sample sets. The x-axis is the quantiles of x and the y-axis is the quantiles of y.

Value parameters

x

a sample set.

y

a sample set.

Attributes

def qqplot(x: Array[Int], d: DiscreteDistribution): Canvas

QQ plot of samples to given distribution. The x-axis is the quantiles of x and the y-axis is the quantiles of given distribution.

QQ plot of samples to given distribution. The x-axis is the quantiles of x and the y-axis is the quantiles of given distribution.

Value parameters

d

a distribution.

x

a sample set.

Attributes

def qqplot(x: Array[Int], y: Array[Int]): Canvas

QQ plot of two sample sets. The x-axis is the quantiles of x and the y-axis is the quantiles of y.

QQ plot of two sample sets. The x-axis is the quantiles of x and the y-axis is the quantiles of y.

Value parameters

x

a sample set.

y

a sample set.

Attributes

def screeplot(varianceProportion: Array[Double]): Canvas

The scree plot is a useful visual aid for determining an appropriate number of principal components. The scree plot graphs the eigenvalue against the component number. To determine the appropriate number of components, we look for an "elbow" in the scree plot. The component number is taken to be the point at which the remaining eigenvalues are relatively small and all about the same size.

The scree plot is a useful visual aid for determining an appropriate number of principal components. The scree plot graphs the eigenvalue against the component number. To determine the appropriate number of components, we look for an "elbow" in the scree plot. The component number is taken to be the point at which the remaining eigenvalues are relatively small and all about the same size.

Value parameters

varianceProportion

The proportion of variance contained in each principal component.

Attributes

def splom(data: DataFrame, mark: Char, color: Color): PlotGrid

Scatterplot Matrix (SPLOM).

Scatterplot Matrix (SPLOM).

Value parameters

data

a data frame.

mark

the legend for all classes.

Attributes

Returns

the plot panel.

def splom(data: DataFrame, mark: Char, category: String): PlotGrid

Scatterplot Matrix (SPLOM).

Scatterplot Matrix (SPLOM).

Value parameters

category

the category column for coloring.

data

an attribute frame.

mark

the legend for all classes.

Attributes

Returns

the plot panel.

def spy(matrix: SparseMatrix, k: Int): Canvas

Visualize sparsity pattern.

Visualize sparsity pattern.

Value parameters

matrix

a sparse matrix.

Attributes

def staircase(data: Array[Array[Double]], color: Color, label: String): Canvas

Create a plot canvas with the staircase line plot.

Create a plot canvas with the staircase line plot.

Value parameters

data

a n x 2 or n x 3 matrix that describes coordinates of points.

Attributes

def surface(z: Array[Array[Double]], palette: Array[Color]): Canvas

3D surface plot.

3D surface plot.

Value parameters

palette

the color palette.

z

the z-axis values of surface.

Attributes

Returns

the plot canvas which can be added other shapes.

def surface(x: Array[Double], y: Array[Double], z: Array[Array[Double]], palette: Array[Color]): Canvas

3D surface plot.

3D surface plot.

Value parameters

palette

the color palette.

x

the x-axis values of surface.

y

the y-axis values of surface.

z

the z-axis values of surface.

Attributes

Returns

the plot canvas which can be added other shapes.

def text(texts: Array[String], coordinates: Array[Array[Double]]): Canvas

Text plot.

Text plot.

Value parameters

coordinates

a n-by-2 or n-by-3 matrix that are the coordinates of texts.

texts

the texts.

Attributes

def wireframe(vertices: Array[Array[Double]], edges: Array[Array[Int]]): Canvas

Wire frame plot. A wire frame model specifies each edge of the physical object where two mathematically continuous smooth surfaces meet, or by connecting an object's constituent vertices using straight lines or curves.

Wire frame plot. A wire frame model specifies each edge of the physical object where two mathematically continuous smooth surfaces meet, or by connecting an object's constituent vertices using straight lines or curves.

Value parameters

edges

an m-by-2 array of which each row is the vertex indices of two end points of each edge.

vertices

a n-by-2 or n-by-3 array which are coordinates of n vertices.

Attributes