nos.contour: nos.image text-based contour plot.

Description Usage Arguments Note Author(s) See Also Examples

View source: R/NostalgiR.R

Description

Produces a text-based contour plot for the visualization of three-dimensional data that are stored in a matrix.

Usage

1
2
3
4
nos.contour(data, xmin = 1, xmax = dim(data)[1], ymin = 1,
  ymax = dim(data)[2], xlab = NULL, ylab = NULL, ratio = 0.35,
  width = round(options()$width * 0.8), height = round(ratio * width),
  pch = 1:5)

Arguments

data

A numeric matrix of data to be plotted. NA and NaN are allowed, but are removed for the plot. Infinities will cause an error.

xmin

A numeric value indicating the smallest x-axis value, which corresponds to the first row of data.

xmax

A numeric value indicating the greatest x-axis value, which corresponds to the last row of data.

ymin

A numeric value indicating the smallest y-axis value, which corresponds to the first column of data.

ymax

A numeric value indicating the greatest y-axis value, which corresponds to the last column of data.

xlab

Label of the x-axis of the plot.

ylab

Label of the y-axis of the plot.

ratio

Coefficient that controls the aspect ratio of the plot.

width

Width of the plot in points.

height

Height of the plot in points.

pch

A vector of single-character symbols. The length of the vector determines the number of contours to be plotted. From left to right, the symbols represent an increasing order of contour values.

Note

Due to rounding to a relatively crude grid results can only be approximate. The equally spaced axis ticks, for example, may be non-equally spaced in the plot. Further, due to the crude grid also there might be several points per character. The function uses the same plotting symbol no matter how many points coincide on one character position. The contour values are equally spaced quantiles between the 5% and 95% level, and are produced using the quantile function. The legend reports the value associated with each contour.

Author(s)

Hien D. Nguyen

See Also

quantile, contour, contourLines, volcano, and txtplot.

Examples

1
2
3
4
5
6
7
## Produce the contour plot of the volcano dataset, using the default plotting symbols.
library(datasets)
nos.contour(volcano)

## Produce the contour plot of the volcano dataset, using the plotting symbols letters[1:3].
library(datasets)
nos.contour(volcano,pch=letters[1:3])

Example output

Loading required package: txtplot
   +-+------------+-----------+------------+------------+------+
60 +                  22  2222                    11           +
   |       22222222333333333 222222222             1           |
   |     22    33333  4444 3333      222           1           |
50 +    2    333444444   44444333      2222        1           +
   |   22 333 444  5555555   4   333333   222222   11          |
   |  22 33 444  555  5555    4        33333333222  1111111    |
40 +  2 3  44   55  55 5      444             33 22       111  +
   |   3   4  55   55           444444         3   222         |
   |  233 44  5    5                 4444       3    222       |
30 +  2 3 44  55   55        55         44       33     222    +
   |  22 3 4   5    555     555           44444    3    222    |
   |   2233 4  55      555  555               444   3 222      |
20 +    223344  555555555                       4   32         +
   |     2233444           444444444444444444  44  3 2         |
   |      2233 44444    4444                4444   3 22        |
10 +       22 33    44444   33333333     3        3322         +
   |       22   3        333        33333 33333333  2          |
   |       22   33     333    222                   2          |
 0 +        22   3333333   2222 22                 2           +
   +-+------------+-----------+------------+------------+------+
     0           20          40           60           80       
Legend: 1 ~ 97; 2 ~ 110; 3 ~ 124; 4 ~ 147; 5 ~ 179
   +------------+-------------+------------+------------+------+
60 +                                              a            +
   |              bbbbbbbbb                       a            |
   |          bbbbb       bbbb                    aa           |
50 +       bbb                bb                   a           +
   |     bbb      ccccccc       bbbbbb             aa          |
   |   bbb      ccc ccccc             bbbbbbbb      aaaaaaa    |
40 +  bb      ccc  cc c                       b           aaa  +
   |  b      cc   c                            b               |
   |  b      c    c                            bb              |
30 +  bb     c    c         cc                  bbb            +
   |   b     cc    ccc     cccc                   bb           |
   |    b     cc      ccc  ccc                     bb          |
20 +     b     cccccccc                            bb          +
   |     bb                                        b           |
   |      bbb                                      b           |
10 +         bb            bbbbbbbbb    bb       bbb           +
   |          bb        bbb        bbbbb bbbbbbbbb             |
   |           bb     bbb                                      |
 0 +            bbbbbbb                                        +
   +------------+-------------+------------+------------+------+
   0           20            40           60           80       
Legend: a ~ 97; b ~ 124; c ~ 179

NostalgiR documentation built on May 2, 2019, 2:45 p.m.