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

Added intuitive colors and color option #173

Closed
wants to merge 6 commits into from

Conversation

davidr9708
Copy link
Contributor

  1. I added more intuitive colors to identify the state of the colors to avoid any kind of MISLEADING interpretation. Ex: "Red = remove" is more intuitive to know that column needs to be removed than the default ggplot colors (blue or pink).

  2. I added a color option if anyone wants to use other colors (which might be more intuitive for them)

1. I added more intuitive colors to identify the state of the colors to avoid any kind of MISLEADING interpretation. Ex: "Red = remove" is more intuitive to know that column needs to be removed than the default ggplot colors (blue or pink).

2. I added a color option if anyone wants to use other colors (which might be more intuitive for them)
@davidr9708
Copy link
Contributor Author

My pull also solves the inconsistency problem mentioned here: #129

@@ -26,6 +26,10 @@

plot_missing <- function(data,
group = list("Good" = 0.05, "OK" = 0.4, "Bad" = 0.8, "Remove" = 1),
fill_color = c("Good" = "#1B9E77",
Copy link
Owner

Choose a reason for hiding this comment

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

This will work for the default case, but will break if number of groups is not 4.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! I think I only need to add error messages when groups' names are different from fill_color's names to make them aware of their errors, most people will use the default groups.

1. I added more intuitive colors to identify the state of the colors to avoid any kind of MISLEADING interpretation. Ex: "Red = remove" is more intuitive to know that column needs to be removed than the default ggplot colors (blue or pink).

2. Added a color option if anyone wants to use other colors (which might be more intuitive for them)

3. Add error messages when groups' names are different from fill_color's names
1. I added more intuitive colors to identify the state of the colors to avoid any kind of MISLEADING interpretation. Ex: "Red = remove" is more intuitive to know that column needs to be removed than the default ggplot colors (blue or pink).

2. Added a color option if anyone wants to use other colors (which might be more intuitive for them)

3. Add error messages when groups' names are different from fill_color's names
R/plot_missing.r Outdated
missing_only = FALSE,
geom_label_args = list(),
title = NULL,
ggtheme = theme_gray(),
theme_config = list("legend.position" = c("bottom"))) {
## Verify group = fill_color
if (length(group) != length(fill_color)) {
Copy link
Owner

Choose a reason for hiding this comment

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

I have mixed feelings about these. This is what I think the update should include:

  1. When using default, I am fine applying a hard-coded color template.
  2. When not using default (not 4 groups), the color template should be automated instead of throwing an error.
  3. End user should be able to define a customized color template.

I believe we have 1 and 3, but might need to tweak for 2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

1. When using the default, applies a hard-coded color template.
2. When not using the default (not 4 groups), the color template uses ggplot's default colors.
3. End user is able to define a customized color template.
Just change color_fill to plot_fill to make the code easier to understand
@boxuancui boxuancui added this to the v0.9.0 milestone Sep 26, 2022
@boxuancui
Copy link
Owner

Hi @davidr9708 , would you mind pulling your PR into the latest master, since there are some updates in the same file. Apologies for the inconvenience.

@davidr9708
Copy link
Contributor Author

Don't worry, I just pulled it with the new updates of the master branch, please, I'm sure there's not any problem but please, test it before merging it

@boxuancui
Copy link
Owner

Thank you so much @davidr9708 ! I will merge within a few days. Having a busy week and thanks for your patience!

@boxuancui boxuancui added the N/A: duplicate Similar issues already exist or completed label Feb 8, 2023
@boxuancui
Copy link
Owner

Duplicate of #177

@boxuancui boxuancui marked this as a duplicate of #177 Feb 8, 2023
@boxuancui boxuancui closed this Feb 8, 2023
@boxuancui boxuancui removed this from the v0.9.0 milestone Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
N/A: duplicate Similar issues already exist or completed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants