[R] How to Break Axis in Lattice Plot

Larry Ma larry_ma at verizon.net
Fri Dec 12 03:09:36 CET 2008

Thank you very much for the suggestion.  I did check into your sample codes:
it creates an factor for the xyplot to condition on.  However, this causes a
problem as I have already other factor(s) to conditon on.

I figured out a hard way but using the grid.text inserting "//" at the
physical location to give readers a percetion of breaking the axis.  In
addtion, one has to recode the values so that extreme values are closer to
the value before "//" and finally relabel the extreme values as well.

I wish there is a better way to break the axis in the lattice plot.

> ----- Original Message ----- 
> From: "Deepayan Sarkar" <deepayan.sarkar at gmail.com>
> To: "Larry Ma" <larry_ma at verizon.net>
> Cc: <r-help at r-project.org>
> Sent: Wednesday, December 10, 2008 3:44 PM
> Subject: Re: [R] How to Break Axis in Lattice Plot
>> You can use shingles: see (compare to Figure 10.15)
>> http://lmdvr.r-forge.r-project.org/figures/figures.html?chapter=10;figure=10_16;theme=stdBW;code=right
>> -Deepayan
>> On Tue, Dec 9, 2008 at 8:04 PM, Larry Ma <larry_ma at verizon.net> wrote:
>>> Dear All,
>>> I have searched the following problem in the R help achives, and there 
>>> did
>>> not seem to be solutio for it.
>>> The problem is how to break the axis in the xyplot (lattice plot).  I 
>>> read
>>> the posts using the package plotrix, buy it doesn't work with the 
>>> xyplot,
>>> which is lattice based.
>>> A simple example is attached below:
>>> xyplot(c(1:10,100)~c(1:10,100))
>>> What I would like to do is break the axis from 10 to 100 so that the 
>>> scale
>>> from 1:10 still intact, but I can show the data at 100 as well.  It has 
>>> to
>>> be based on xyplot as I have conditions in my data.

More information about the R-help mailing list