[R] Additions to xyplot (lattice)? - legend, ticks, axis label size, text

Dave Hewitt dhewitt at vims.edu
Fri Aug 31 23:57:01 CEST 2007


I have a final Figure that looks terrific. Thanks Deepayan. Comments below.

At 01:35 PM 8/31/2007 -0700, Deepayan Sarkar wrote:
>On 8/31/07, Dave Hewitt <dhewitt at vims.edu> wrote:
> > At 12:47 PM 8/30/2007 -0700, deepayan.sarkar at gmail.com wrote:
> > >On 8/30/07, Dave Hewitt <dhewitt at vims.edu> wrote:
> > > > Thank you very much... simple and easy fixes.
> > > >
> > > > Three"final" queries:
> > > >
> > > > (1) I need to make a little more room on the left for the larger axis
> > > > label. I tried 'mex' in the list for ylab but that was ignored.
> > >
> > >It's possible, but shouldn't be necessary. Can you provide a
> > >reproducible example which shows why you need this?
> >
> > I definitely can if needed, but... it's not that the axis label doesn't
> > fit, it's just that I'd like a little more white space. So it may not match
> > up with standard rules, but it's for a specific purpose. Please let me know
> > how to adjust it.
>
>Add something like
>
>par.settings = list(layout.widths = list(ylab = 2))

Excellent.


> > Also, might this interact with my choice of plot size prior to production,
> > with:
> >
> > win.graph(width = 10, height = 7)
>
>Do you want it to interact? I don't think width and height matter, but
>pointsize (or whatever its equivalent for win.graph) might.

I don't want it to [and wouldn't know why I would  :) ]. I just thought 
that might be a cause of the squishiness on the y-axis (though, again, the 
squishiness was just a personal preference thing).


> > > > (2) Is it possible to place a tick at each year on the x-axis, but only
> > > > label every other year?
> > >
> > >Not in those terms, but you can explicitly specify labels as
> > >
> > >scales = list(x = list(at = c(1, 2, 3), labels = c("a", "", "c")))
> > >
> > >etc.
> >
> > So no ticks without labels, as specified by the user? The above generates
> > only ticks with labels.
>
>Yes, but the second label is blank (""). Why is that not enough?

Yep, duh. Sorry.


>For finer control of tick marks and labels, you can specify a custom
>function that computes these. See ?xscale.components.default, but this
>is not very well documented and you will have to look into the sources
>a bit.

Maybe later. :)


>-Deepayan



More information about the R-help mailing list