[R] Two different scales for the same axis in the same plot.

Greg Snow Greg.Snow at imail.org
Fri Apr 10 20:05:45 CEST 2009


Look at the gap.plot function in the plotrix package.  It may work for you, or if not, looking at the code may give you some ideas of how to make a similar plot with the different scales that you want.

-- 
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 George Chen
> Sent: Friday, April 10, 2009 11:38 AM
> To: r-help at r-project.org
> Subject: [R] Two different scales for the same axis in the same plot.
> 
> Hello,
> 
> Could anyone tell me how to plot data on two different scales in the
> same axis in the same plot?
> Here is my quandary:
> The range of my X axis runs from 0 to 10, but the majority of my
> meaningful data
> lies between 7 and 10.  The data from 0 to 7 is essentially noise.
> Is there a way for me to present my data such that the range from 0 to
> 7 takes
> up a smaller amount of space on the graph compared to the range from 7
> to 10
> so that I can see more of the details in 7 to 10?
> 
> Thanks in advance,
> 
> George Chen
> 
> ______________________________________________
> 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