Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the full range of the palette for binned viridis #4737

Merged
merged 3 commits into from
Jun 10, 2022

Conversation

gregleleu
Copy link
Contributor

Resolves #4372
Adding a parameter to use the full width of the scale in scale_*_viridis_b functions.

"viridis_b",
gradient_n_pal(
guide = "coloursteps", aesthetics = "colour", pal_full_range = FALSE) {
if(pal_full_range) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be an option? Wouldn't you always want to use the full range?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per our discussion in #4372 with @clauswilke @yutannihilation: both ways of doing it could make sense

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please provide an argument as to why the current behaviour would ever be desired?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say that I can. Maybe @clauswilke @yutannihilation?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea. I was just saying the current behavior is understandable. I'm not sure what behavior is desirable, sorry.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thomasp85 should issue a final ruling, but I'm pretty sure the original behaviour was a mistake, and we should just always use the full range. We'll need to flag this as a visual change in the NEWS.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree - we should just go with the approach in this PR. The original implementation was an error on my part

@thomasp85
Copy link
Member

@gregleleu do you want to finish this off, given the feedback above?

@gregleleu
Copy link
Contributor Author

@thomasp85 Sure, so removing the pal_full_range argument I had added and making this the new default behavior + mention in the NEWS, is that right?

@thomasp85
Copy link
Member

@gregleleu sorry for missing the question — Yes exactly. This PR will implement the one true behaviour

Removes argument to choose between behaviors
@thomasp85 thomasp85 merged commit 99149fc into tidyverse:main Jun 10, 2022
@thomasp85
Copy link
Member

Thanks @gregleleu — as an advise for the future begin to develop PRs in their own separate branch instead of in main

@gregleleu
Copy link
Contributor Author

@thomasp85
Thanks for the feedback, how would that work typically? I create my own branch and work on the feature there. Then I create a PR for my branch to the upstream main? Or is it that the PR copies my branch upstream and then you merge into main?

@thomasp85
Copy link
Member

The first basically. You keep the main branch as a complete copy of the upstream main and only use it as base for new branches to make PRs from.

The usethis package has some helpful functions for this workflow. You basically use usethis::pr_init(<branch name>) to create a new branch for a PR, then upon the first usethis::pr_push() a PR is set up against the upstream main branch etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scale_*_viridis_b not using full width of palette
4 participants