Skip to content

how to label customized y axis when using lattice parallel parameter common.scale=TRUE

4 messages · Deepayan Sarkar, Pengcheng Yang

#
Dear all,

When I use parallel function in lattice package, I want to label the 
y-axis with customized numbers. Like this:

parallel(~iris[1:4] | Species, iris,horiz=FALSE,common.scale=TRUE,
     scales=list(y=list(at=c(0,2,3))))

But only "Min" label in the y-axis, nothing happened. Could anyone help me?

Thanks.
Regards,

Pengcheng Yang
#
On Tue, Apr 5, 2011 at 4:39 PM, Pengcheng Yang <pengchy at gmail.com> wrote:
Parallel does not directly support that, and will insist on scaling
the data. However, you can control the scaling (using 'lower' and
'upper'), and override a couple of other arguments to get what you
want:

parallel(~iris[1:4] | Species, iris,
         xlim = extendrange(range(iris[1:4])),
         scales = list(x = list(at = NULL, labels = NULL)),
         lower = 0, upper = 1)

This is for horizontal.axis = TRUE, adjust accordingly for FALSE.

-Deepayan
#
Thanks Deepayan, It works!
On 2011-4-5 21:42, Deepayan Sarkar wrote:
#
I have readjust the script as follows to retain the complete information 
of original graph, the background vertical bar.


parallel(~iris[1:4] | Species, iris,horizon=FALSE,
          ylim = extendrange(range(iris[1:4])),
          scales = list(y = list(at = NULL, labels = NULL),x=list(rot=45)),
          lower = 0, upper = 1,
          panel=function(x,y,z,...){
            panel.abline(v=1:4,col="gray90")
            panel.parallel(x,y,z,...)
          })
On 2011-4-5 21:42, Deepayan Sarkar wrote: