Skip to content

scale_x_continuous: data is dropped even when na.value is set #522

Closed
@wch

Description

@wch

Examples:

dat <- data.frame(x=1:10)

ggplot(dat, aes(x=x, y=x, colour=x)) + geom_point()

# Shrink colour range: out-of-range points get na.value
ggplot(dat, aes(x=x, y=x, colour=x)) + geom_point() +
  scale_colour_continuous(limits=c(4,7), na.value="red")

# Shrink x range: out-of-range points are removed
# They should show up at x=5.5
ggplot(dat, aes(x=x, y=x, colour=x)) + geom_point() +
  scale_x_continuous(limits=c(4,7), na.value=5.5)
# Warning message:
# Removed 6 rows containing missing values (geom_point). 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions