0

I want to specify some options in a levelplot() of the R package lattice. I set the argument scales and this works fine:

scales = list(x = list(at = c(0:8*16 +.5),
                   cex = 0), 
          y = list(at = c(0:8*16+.5),
                   cex = 0))    

Now, I want to have this argument as default. I.e. I want to have this scales in each levelplot() in the session without specifying this argument each time. I tried to do this with lattice.options() but I don't know how.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Nairolf
  • 2,418
  • 20
  • 34

2 Answers2

1

How about lattice::trellis.par.set()?

Matthew Lundberg
  • 42,009
  • 6
  • 90
  • 112
0

Settings objects are retrieved with trellis.par.get("name of component to be set"). as example:

plot.line.settings <- trellis.par.get("plot.line")

The plot.line.settings object is list and its items can be changed/update. Then you set the global settings:

trellis.par.set("plot.line", plot.line.settings)

To make the settings applicable to any future opened devices, must set retain argument to TRUE when opening a device.

DorinPopescu
  • 715
  • 6
  • 10