Package

smile.plot

swing

Permalink

package swing

Swing based data visualization.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. swing
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class CanvasWindow(frame: JFrame, canvas: Canvas) extends JWindow with Product with Serializable

    Permalink

    Plot canvas window.

  2. trait JWindow extends AnyRef

    Permalink

    JFrame window.

  3. case class PlotGridWindow(frame: JFrame, canvas: PlotGrid) extends JWindow with Product with Serializable

    Permalink

    Plot grid window.

Value Members

  1. object Html

    Permalink

    HTML tag of Canvas and JComponent.

  2. object JWindow

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

    Permalink

    Box plot.

    Box plot.

    data

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

    labels

    the labels for each box plot.

    returns

    the plot canvas which can be added other shapes.

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

    Permalink

    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 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 of 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.
    data

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

    returns

    the plot canvas which can be added other shapes.

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

    Permalink

    Contour 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.

    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.

    returns

    the plot canvas which can be added other shapes.

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

    Permalink

    Contour 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.

    z

    the data matrix to create contour plot.

    levels

    the level values of contours.

    returns

    the plot canvas which can be added other shapes.

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

    Permalink

    Contour 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.

    z

    the data matrix to create contour plot.

    returns

    the plot canvas which can be added other shapes.

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

    Permalink

    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.

    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.

    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.

  9. def dendrogram(hc: HierarchicalClustering): Canvas

    Permalink

    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.

    hc

    hierarchical clustering object.

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

    Permalink

    2D grid plot.

    2D grid plot.

    data

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

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

    Permalink

    Pseudo heat map plot.

    Pseudo heat map plot.

    rowLabels

    the labels for rows of data matrix.

    columnLabels

    the labels for columns of data matrix.

    z

    a data matrix to be shown in pseudo heat map.

    palette

    the color palette.

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

    Permalink

    Pseudo heat map plot.

    Pseudo heat map plot.

    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.

    palette

    the color palette.

  13. def heatmap(z: Array[Array[Double]], palette: Array[Color] = Palette.jet(16)): Canvas

    Permalink

    Pseudo heat map plot.

    Pseudo heat map plot.

    z

    a data matrix to be shown in pseudo heat map.

    palette

    the color palette.

  14. def hexmap(z: Array[Array[Double]], palette: Array[Color] = Palette.jet(16)): Canvas

    Permalink

    Heat map with hex shape.

    Heat map with hex shape.

    z

    a data matrix to be shown in pseudo heat map.

    palette

    the color palette.

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

    Permalink

    Histogram plot.

    Histogram plot.

    data

    a sample set.

    breaks

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

  16. def hist(data: Array[Double], k: Int = 10, prob: Boolean = false, color: Color = Color.BLUE): Canvas

    Permalink

    Histogram plot.

    Histogram plot.

    data

    a sample set.

    k

    the number of bins.

  17. def hist3(data: Array[Array[Double]], xbins: Int = 10, ybins: Int = 10, prob: Boolean = false, palette: Array[Color] = Palette.jet(16)): Canvas

    Permalink

    3D histogram plot.

    3D histogram plot.

    data

    a sample set.

    xbins

    the number of bins on x-axis.

    ybins

    the number of bins on y-axis.

  18. def line(data: Array[Array[Double]], style: Style = Line.Style.SOLID, color: Color = Color.BLACK, mark: Char = ' ', label: String = null): Canvas

    Permalink

    Line plot.

    Line plot.

    data

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

    style

    the stroke style of line.

    color

    the color of line.

    mark

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

    returns

    the plot canvas which can be added other shapes.

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

    Permalink

    Scatter plot.

    Scatter plot.

    data

    the data frame.

    x

    the column as x-axis.

    y

    the column as y-axis.

    z

    the column as z-axis.

    category

    the category column for coloring.

    returns

    the plot canvas which can be added other shapes.

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

    Permalink

    Scatter plot.

    Scatter plot.

    data

    the data frame.

    x

    the column as x-axis.

    y

    the column as y-axis.

    z

    the column as z-axis.

    returns

    the plot canvas which can be added other shapes.

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

    Permalink

    Scatter plot.

    Scatter plot.

    data

    the data frame.

    x

    the column as x-axis.

    y

    the column as y-axis.

    category

    the category column for coloring.

    returns

    the plot canvas which can be added other shapes.

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

    Permalink

    Scatter plot.

    Scatter plot.

    data

    the data frame.

    x

    the column as x-axis.

    y

    the column as y-axis.

    returns

    the plot canvas which can be added other shapes.

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

    Permalink

    Scatter plot.

    Scatter plot.

    x

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

    y

    class label.

    returns

    the plot canvas which can be added other shapes.

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

    Permalink

    Scatter plot.

    Scatter plot.

    x

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

    y

    labels of points.

    returns

    the plot canvas which can be added other shapes.

  25. def plot(x: Array[Array[Double]], mark: Char = '*', color: Color = Color.BLACK): Canvas

    Permalink

    Scatter plot.

    Scatter plot.

    x

    a n-by-2 or n-by-3 matrix that describes coordinates of 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
    color

    the color used to draw points.

    returns

    the plot canvas which can be added other shapes.

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

    Permalink

    QQ plot of two sample sets.

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

    x

    a sample set.

    y

    a sample set.

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

    Permalink

    QQ plot of samples to 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.

    x

    a sample set.

    d

    a distribution.

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

    Permalink

    QQ plot of two sample sets.

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

    x

    a sample set.

    y

    a sample set.

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

    Permalink

    QQ plot of samples to 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.

    x

    a sample set.

    d

    a distribution.

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

    Permalink

    QQ plot of samples to standard 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.

    x

    a sample set.

  31. def screeplot(pca: PCA): Canvas

    Permalink

    The scree plot is a useful visual aid for determining an appropriate number of principal components.

    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.

    pca

    principal component analysis object.

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

    Permalink

    Scatterplot Matrix (SPLOM).

    Scatterplot Matrix (SPLOM).

    data

    an attribute frame.

    mark

    the legend for all classes.

    category

    the category column for coloring.

    returns

    the plot panel.

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

    Permalink

    Scatterplot Matrix (SPLOM).

    Scatterplot Matrix (SPLOM).

    data

    a data frame.

    mark

    the legend for all classes.

    returns

    the plot panel.

  34. def spy(matrix: SparseMatrix, k: Int = 1): Canvas

    Permalink

    Visualize sparsity pattern.

    Visualize sparsity pattern.

    matrix

    a sparse matrix.

  35. def staircase(data: Array[Array[Double]], color: Color = Color.BLACK, label: String = null): Canvas

    Permalink

    Create a plot canvas with the staircase line plot.

    Create a plot canvas with the staircase line plot.

    data

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

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

    Permalink

    3D surface plot.

    3D surface plot.

    x

    the x-axis values of surface.

    y

    the y-axis values of surface.

    z

    the z-axis values of surface.

    palette

    the color palette.

    returns

    the plot canvas which can be added other shapes.

  37. def surface(z: Array[Array[Double]], palette: Array[Color] = Palette.jet(16)): Canvas

    Permalink

    3D surface plot.

    3D surface plot.

    z

    the z-axis values of surface.

    palette

    the color palette.

    returns

    the plot canvas which can be added other shapes.

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

    Permalink

    Text plot.

    Text plot.

    texts

    the texts.

    coordinates

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

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

    Permalink

    Wire frame plot.

    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.

    vertices

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

    edges

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

Inherited from AnyRef

Inherited from Any

Ungrouped