Description Usage Arguments Note Author(s) See Also Examples
Plots a text-based of a histogram, with the option to plot densities or frequencies.
1 2 3 |
data |
A numeric vector containing the values to be plotted. |
breaks |
Either a numerical value or a character string to specify the number of breaks to used. The default setting is |
freq |
If |
xlab |
Label of the x-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 single-character plot symbol. |
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. Histogram columns are plotted at the midpoint of each bin.
Hien D. Nguyen
1 2 3 4 5 6 7 8 9 | ## Plot a histogram for the frequencies of 100 random standard normal points
## using 'Sturges' breaks and plot symbol 'o'.
data <- rnorm(100)
nos.hist(data)
## Plot a histogram for the densities of 1000 random chi-squared(3) points
## using 'FD' breaks and plot symbol '#'.
data <- rchisq(1000,3)
nos.hist(data,breaks='FD',freq=FALSE,pch='#')
|
Loading required package: txtplot
+----------+-----------+-----------+----------+-----------+
20 + o +
| o o |
F | o o |
r 15 + o o o o +
e | o o o o |
q | o o o o |
u 10 + o o o o +
e | o o o o |
n | o o o o o o o |
c 5 + o o o o o o o o +
y | o o o o o o o o |
| o o o o o o o o o |
0 + o o o o o o o o o o +
+----------+-----------+-----------+----------+-----------+
-1 0 1 2
+-+-------------+------------+-------------+------------+
0.25 + # +
| # # |
0.2 + # # +
D | ## ## |
e | ## ### |
n 0.15 + ### ### # +
s | ### ### ## |
i 0.1 + ### ### ## # +
t | ### ### ## ## |
y | ### ### ## ### # |
0.05 + ### ### ## ### ### +
| ### ### ## ### ### ## ## |
0 + ### ### ## ### ### ## ### ### ### ## ### ### ## ### +
+-+-------------+------------+-------------+------------+
0 5 10 15
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.