> How do you persuade lattice to draw tick marks on both the left and 
right 
> side of the y-axis, when relation="free" in the scales component?
> 
> #Ticks appear on both sides
> histogram(~height|voice.part, data=singer)
> 
> ##Ticks only on left
> histogram(~height|voice.part, data=singer, 
> scales=list(y=list(relation="free")))

I had an off list reply that was very helpful, suggesting the use of 
panel.axis.   For posterity, here's my own answer to my problem, using 
yscale.component. It's not a particularly natural solution, and it 
requires manually increasing the horizontal spacing between plots (with 
the between agrument), but it works.

myyscale.component <- function(...)
{
  ans <- yscale.components.default(...)
  ans$right <- ans$left
  ans$right$labels$labels <- NULL
  ans
} 

histogram(~height|voice.part, data=singer, 
   scales=list(y=list(relation="free")),
   yscale.component=myyscale.component,
   between=list(x=.5))

Regards,
Richie.

Mathematical Sciences Unit
HSL


------------------------------------------------------------------------
ATTENTION:

This message contains privileged and confidential inform...{{dropped:20}}

______________________________________________
[email protected] 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.

Reply via email to