-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This appears to do the trick - I used a tip from tidyverse/ggplot2#3738 (comment) @gritzenthaler would you mind testing this out to make sure I didn't miss anything?
- Loading branch information
Showing
2 changed files
with
29 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
bbdbd8c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Daniel, this seems to work very well for the color aesthetic. I'm struggling to come up with a good non-map example for testing this in the fill aesthetic, but I have no doubt it would work since the code structures are identical.
Slightly off-topic, this reminds me of a problem I ran into while working on something else this week. I was trying to apply a continuous color palette to a choropleth map with defined classification bins, and ended up using the Viridis package because its fill function has a discrete=TRUE option. Maps are beyond the scope of this project, but perhaps someone might have a graphical need for displaying a continuous palette in binned form? Do you think it's worth taking the time to add a "discrete" argument to the functions? @matthewstern what do you think? (The Viridis source code is here for reference: https://github.com/sjmgarnier/viridis/blob/master/R/scales.R. I'm poking around in it now.)