Re: [R] how to specify the location of tick mark on x axies

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Sat, 16 Feb 2008 07:46:47 -0500

Xin wrote:
> Dear:
>
> I want to plot barplot and let bar be in the middle of each x axis category.
>
> Do you have this experience?
>
> Many Thanks!
>
> Xin
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

 > x <- rnorm(100)
 > h <- hist(x, axes=F)
 > str(h)
List of 7
 $ breaks     : num [1:10] -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5
 $ counts     : int [1:9] 2 7 23 17 28 9 10 2 2
 $ intensities: num [1:9] 0.04 0.14 0.46 0.34 0.56 ...
 $ density    : num [1:9] 0.04 0.14 0.46 0.34 0.56 ...
 $ mids       : num [1:9] -1.75 -1.25 -0.75 -0.25 0.25 0.75 1.25 1.75 2.25
 $ xname      : chr "x"

 $ equidist : logi TRUE

I'd say that graphically it's not the best idea, but it's not hard to do. If you want variations, see the manual pages ?hist, ?axis, etc.

Duncan Murdoch



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 16 Feb 2008 - 12:52:01 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 16 Feb 2008 - 14:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive