Skip to content

Interaction between breaks and scales is confusing #501

Closed
@wch

Description

@wch

This is a followup to #264.

p <- qplot(mpg, wt, data = mtcars, colour = factor(cyl))

# Works (fixed in 264)
p + scale_colour_manual(values = c("8" = "red","4" = "blue","6" = "green"))

# Doesn't work
p + scale_colour_manual(breaks=c(8, 4, 6), values=c("red", "green", "blue"))

This should be added to the existing test:

test_that("names of values used in manual scales", {
  # ... other test already here...

   s <- scale_colour_manual(breaks = c(8, 4, 6), values = c("c", "a", "b"))
   scale_train(s, c("4", "6", "8"))
   expect_equal(scale_map(s, c("4", "6", "8")), c("a", "b", "c"))  
})

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions