You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to force a continuous raster legend to display when the raster layer contains no non-NA values? Or else to manually add a continuous raster legend?
Consider the following example, where a list of tmap objects describes a temporally varying attribute. Note that in the first time step, the entire raster has value NA - this results in a map with no legend. For animation, and even just for consistency of map layout, having a consistent legend is obviously important.
One workaround is to give one cell a value, e.g. with r0[1] <- 0, but I would prefer not to modify cell values.
This was a bug that now has been fixed: when the user provides a tm_scale function for a layer with all NA's, it will now show a legend, provided the essential information is there (limits for tm_scale_continuous and breaks for tm_scale_intervals).
However, you can make these series of plots in one go:
Is it possible to force a continuous raster legend to display when the raster layer contains no non-NA values? Or else to manually add a continuous raster legend?
Consider the following example, where a list of tmap objects describes a temporally varying attribute. Note that in the first time step, the entire raster has value
NA
- this results in a map with no legend. For animation, and even just for consistency of map layout, having a consistent legend is obviously important.One workaround is to give one cell a value, e.g. with
r0[1] <- 0
, but I would prefer not to modify cell values.Created on 2024-09-24 with reprex v2.1.1
Session info
The text was updated successfully, but these errors were encountered: