An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130319/ddcc2ad6/attachment.pl>
Cumulative Frequency Graph
5 messages · Shane Carey, Rui Barradas, Peter Ehlers +1 more
Hello,
Try setting the argument xaxt (x axis type) to "n" (no x axis) and then
use ?axis.
plot(breaks, cumfreq0, # plot the data
main="Old Faithful Eruptions", # main title
xlab="Duration minutes", # x?axis label
ylab="Cumulative eruptions", # y?axis label
xaxt = "n")
lines(breaks, cumfreq0)
axis(1, at = duration)
Hope this helps,
Rui Barradas
Em 19-03-2013 12:34, Shane Carey escreveu:
Hi, I am trying to create a Cumulative Frequency graph and I am using the following example: http://www.r-tutor.com/elementary-statistics/quantitative-data/cumulative-frequency-graph When I plot this data, how do I put in "real values" on the x-axis, rather than the values that are used for the breaks Thanks
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130319/d98e28b2/attachment.pl>
On 2013-03-19 07:06, Shane Carey wrote:
Hi Rui, Thanks. This works fine, but how do I only have showing the values where the breaks are? For my "duration" data, I have over 3541 records and I only want to show the data at the breaks. Thanks
The first thing to try is .... read the help page! ?axis will show you how to use the 'at' and 'labels' arguments of the axis() function. Peter Ehlers
On Tue, Mar 19, 2013 at 2:00 PM, Rui Barradas <ruipbarradas at sapo.pt> wrote:
Hello,
Try setting the argument xaxt (x axis type) to "n" (no x axis) and then
use ?axis.
plot(breaks, cumfreq0, # plot the data
main="Old Faithful Eruptions", # main title
xlab="Duration minutes", # x-axis label
ylab="Cumulative eruptions", # y-axis label
xaxt = "n")
lines(breaks, cumfreq0)
axis(1, at = duration)
Hope this helps,
Rui Barradas
Em 19-03-2013 12:34, Shane Carey escreveu:
Hi,
I am trying to create a Cumulative Frequency graph and I am using the following example: http://www.r-tutor.com/**elementary-statistics/** quantitative-data/cumulative-**frequency-graph<http://www.r-tutor.com/elementary-statistics/quantitative-data/cumulative-frequency-graph> When I plot this data, how do I put in "real values" on the x-axis, rather than the values that are used for the breaks Thanks
On 03/19/2013 11:34 PM, Shane Carey wrote:
Hi, I am trying to create a Cumulative Frequency graph and I am using the following example: http://www.r-tutor.com/elementary-statistics/quantitative-data/cumulative-frequency-graph When I plot this data, how do I put in "real values" on the x-axis, rather than the values that are used for the breaks
Hi Shane, The values in the plot you use as an example are "real" in the sense that they are equal to the time values. If you want different intervals, then it makes sense to add a separate axis. For example: data(faithful) duration = faithful$eruptions breaks = seq(1.5, 5.5, by=0.5) duration.cut = cut(duration, breaks, right=FALSE) duration.freq = table(duration.cut) cumfreq0 = c(0, cumsum(duration.freq)) plot(breaks,cumfreq0, main="Old Faithful Eruptions", xlab="Duration minutes", ylab="Cumulative eruptions",xaxt="n",type="b") axis(1,at=2:5) gives more or less the plot illustrated. Jim