[R] padding "bug" in lattice/levelplot

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Oct 17 05:00:46 CEST 2008


On 10/16/08, Paul Boutros <paul.boutros at utoronto.ca> wrote:
> Hello,
>
>  I have encountered some unexpected behaviour with levelplot that may simply
> be a misunderstanding on my part.
>
>  If I create a levelplot from a matrix with named columns, some "padding"
> space appears at the top and bottom of the heatmap.  Here is an example, [...]

This is because the named columns get treated as a factor, and cause
the corresponding axis annotation code to be triggered. This isn't
easy to fix without major changes. A simple workaround is to change
the padding for factors in the call to levelplot:

levelplot(data, lattice.options = list(axis.padding = list(factor = 0.5)))

It may make sense for this to happen by default; I'll check if that
has any potential drawbacks.

-Deepayan



More information about the R-help mailing list