Closed
Description
Unlike scales for continuous x or y (e.g., scale_x_continuous
), those for color or fill (e.g., scale_color_gradient
) is not supporting expand
option.
At least, I want expand = c(0, 0)
to work so that color bars exactly represents the range of color or fill mappings.
The example below shows that range of color bar is wider than the range specified in limits
argument even if expand = c(0, 0)
is specified.
@yutannihilation figured out this is caused by
Line 336 in 047b528
x <- c(0, 1)
ggplot2::qplot(x, x, color = x) +
ggplot2::scale_color_gradient(breaks = x, limits = x, expand = c(0, 0)) +
ggplot2::guides( # Just for the visibility
color = ggplot2::guide_colorbar(
barheight = grid::unit(1, "npc") - grid::unit(4, "line"),
ticks.linewidth = 2
)
)
Created on 2019-08-29 by the reprex package (v0.3.0)
Metadata
Metadata
Assignees
Labels
No labels