Skip to content

Faint lines through colour steps guide segments when even.steps = FALSE #5481

Closed
@jimjam-slam

Description

@jimjam-slam

This reprex actually comes from the current ggplot2 3.4.4 docs for guide_colorsteps, where it is visible:

df <- expand.grid(X1 = 1:10, X2 = 1:10)
df$value <- df$X1 * df$X2

  p <- ggplot(df, aes(X1, X2)) + geom_tile(aes(fill = value))
# By default each bin in the guide is the same size irrespectively of how
# their sizes relate in data space
p + scale_fill_binned(breaks = c(10, 25, 50))

image

# This can be changed with the `even.steps` argument
p + scale_fill_binned(
  breaks = c(10, 25, 50),
  guide = guide_coloursteps(even.steps = FALSE))

image

When I run this code on ggplot 3.4.4, I can't see the faint lines at low-resolution outputs, but if I run, ggsave at, say, width = 1920, height = 1080, units = 'px', or with SVG output, they're definitely visible. Mapping colour to the same variable as fill hides the lines from the tiles themselves but not from the colour bar (unless there's a way to merge the fill and colour guides rather than hiding one?).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions