[R] Plotting Hints - how to add minor tics on axes

Greg Snow Greg.Snow at imail.org
Wed Aug 12 22:54:01 CEST 2009


You can use the axis function to add tick marks and labels at specified positions (including whatever origin you want to use).  If you add shorter tick marks without labels, then they are minor ticks (usually you will suppress the default axes using axes=FALSE or xaxt/yaxt='n', then use the axis function to add in your own custom ticks and labels (call once for major ticks, a second time for minor).

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Jason Rupert
> Sent: Wednesday, August 12, 2009 12:51 PM
> To: R-help at r-project.org
> Subject: [R] Plotting Hints - how to add minor tics on axes
> 
> Using the standard plotting routine in R, i.e. no special packages, is
> there a way to add in minor tics to the axes?
> 
> Also, is there a way to make sure the major axes labels are at the
> origin?  When I'm looking at a plot, the major axes labels are present,
> but it looks like they start a bit away from the origin on the plot.
> 
> Thanks again for any info and feedback.
> 
> ______________________________________________
> 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.




More information about the R-help mailing list