Waichler, Scott R
2003-Dec-19 20:23 UTC
[R] Different scales for keys in lattice levelplots
Can anyone tell me how to obtain a custom scale for the colorkey in each levelplot of a lattice? I am using lattice and levelplot to plot z = f(x, y) for multiple z variables. x and y values are the same across plots, but units for z are different and therefore I need to create a custom scale for each plot's key. It follows that I need to place each plot's key inside that plot's box. Should I use filled.contour() and gridBase instead? Thanks, Scott Waichler Pacific Northwest National Laboratory scott.waichler at pnl.gov http://hydrology.pnl.gov
On Friday 19 December 2003 14:23, Waichler, Scott R wrote:> Can anyone tell me how to obtain a custom scale for > the colorkey in each levelplot of a lattice? I am using > lattice and levelplot to plot z = f(x, y) for multiple z > variables. x and y values are the same across plots, but > units for z are different and therefore I need to create > a custom scale for each plot's key. It follows that I need > to place each plot's key inside that plot's box. Should I > use filled.contour() and gridBase instead?I'm not sure I understand your question. Are you using different calls to levelplot() for the different z variables ? What's wrong with the default colorkey for each such plot ? In any case, the arguments controlling colorkey are described in the help page for levelplot. Another way to control the scales (to be same across different calls to levelplot, say) is via the 'at' argument to levelplot (this can be used in a manner similar to what might have been expected from a 'zlim' argument, had one been available). Hope that helps, Deepayan