turn off selected axes in bwplot

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

turn off selected axes in bwplot

William Briggs

I want to turn off selected axes in bwplot.  I would like to only have the bottom axis drawn, with the others off.

I have a series of bwplots that I want on one device, like this:

p1<-bwplot(x1,box.ratio=.1)
p2<-bwplot(x2,box.ratio=.1)
...
print(p1,position=c(0,.8,1,1),more=T)
print(p2,position=c(0,.6,1,.8),more=T)
...

I know about the panel functions panel.bwplot() and panel.axis(), but I don't know how to directly call them and change, for example, the side parameter of panel.axis(), leaving all the other parameters of both panel functions untouched.  

The axis can be turned off altogether with:

trellis.par.set(axis.line = list( color="transparent"))

but this is obviously not what I need.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: turn off selected axes in bwplot

Deepayan Sarkar
On 2/6/06, William Briggs <[hidden email]> wrote:
>
> I want to turn off selected axes in bwplot.  I would like to only have the
> bottom axis drawn, with the others off.

Does this do what you want?

bwplot(<...>,
       scales = list(x = list(alternating = 1, tck = c(1, 0))))

This is described in detail under 'scales' in ?bwplot.

-Deepayan

> I have a series of bwplots that I want on one device, like this:
>
> p1<-bwplot(x1,box.ratio=.1)
> p2<-bwplot(x2,box.ratio=.1)
> ...
> print(p1,position=c(0,.8,1,1),more=T)
> print(p2,position=c(0,.6,1,.8),more=T)
> ...
>
> I know about the panel functions panel.bwplot() and panel.axis(), but I
> don't know how to directly call them and change, for example, the side
> parameter of panel.axis(), leaving all the other parameters of both panel
> functions untouched.
>
> The axis can be turned off altogether with:
>
> trellis.par.set(axis.line = list( color="transparent"))
>
> but this is obviously not what I need.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: turn off selected axes in bwplot

William Briggs
In reply to this post by William Briggs
 
> Does this do what you want?
>
> bwplot(<...>,
>       scales = list(x = list(alternating = 1, tck = c(1, 0))))
>
> This is described in detail under 'scales' in ?bwplot.

Not quite.   This controls, if I've understood it correctly, the axis tick marks and such (I also tried the argument "draw=FALSE" in the list above).  

The analogue I have in mind is the simple plot axes control like this

    plot(<...>, axes=FALSE)
    axis(1)

which would only draw the bottom axis, with tick marks and label.  Those arguments, of course, don't work for the lattice graphics, but I did notice a similar control in the panel.aixs() function, but I just don't know how to get to it.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: turn off selected axes in bwplot

Deepayan Sarkar
On 2/6/06, William Briggs <[hidden email]> wrote:

>
> > Does this do what you want?
> >
> > bwplot(<...>,
> >       scales = list(x = list(alternating = 1, tck = c(1, 0))))
> >
> > This is described in detail under 'scales' in ?bwplot.
>
> Not quite.   This controls, if I've understood it correctly, the axis tick
> marks and such (I also tried the argument "draw=FALSE" in the list above).
>
> The analogue I have in mind is the simple plot axes control like this
>
>     plot(<...>, axes=FALSE)
>     axis(1)

OK, so you don't want any y-axes at all? In that case, how about

bwplot(<...>,
      scales = list(x = list(alternating = 1, tck = c(1, 0)),
                     y = list(draw = FALSE)))

?

> which would only draw the bottom axis, with tick marks and label.  Those
> arguments, of course, don't work for the lattice graphics, but I did notice
> a similar control in the panel.aixs() function, but I just don't know how to
> get to it.

You can't easily.

--
http://www.stat.wisc.edu/~deepayan/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html