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

Colorful caterpillars #43

Conversation

befriendabacterium
Copy link
Contributor

Added options to colour effect sizes in caterpillars() by study, defaulting to color-blind friendly palette. ('colour' and 'cb' parameters). I used essentially the 'colour' parameter as in orchard_plot for equivalency but it might be a little confusing given the other colour parameters also in the function. But maybe not. Feel free to rename if you want. Cb also works essentially the same as in orchard_plot.

I wanted to stick to one plotting function but found it tricky to find a solution in ggplot syntax that worked for both no colouring (well, yellow estimates, green errors) and colouring by study. Perhaps something to consider for a future improvement but does the job for now.

image

-add colour parameter/option
-add new section to plot with colours (diff syntax)
-in the study-coloured section, relabel legend
-Add cb option like in orchaRd::orchard_plot
-recolours at end using same method as orchaRd::orchard_plot
-colourblind friendlieness is default
@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (9f359b8) 52.75% compared to head (06179d0) 51.21%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #43      +/-   ##
==========================================
- Coverage   52.75%   51.21%   -1.55%     
==========================================
  Files          11       11              
  Lines         707      740      +33     
==========================================
+ Hits          373      379       +6     
- Misses        334      361      +27     
Files Coverage Δ
R/caterpillars.R 63.20% <65.00%> (-20.36%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@daniel1noble
Copy link
Owner

Thanks Matt. Can you provide a little example code and figure to demonstrate what you mean. Reason being is that, I just introduced one option to change colours a few weeks ago and I just want to be sure the logic doesn't conflict. Cheers!
D

@befriendabacterium
Copy link
Contributor Author

Thanks Matt. Can you provide a little example code and figure to demonstrate what you mean. Reason being is that, I just introduced one option to change colours a few weeks ago and I just want to be sure the logic doesn't conflict. Cheers! D

Hi Dan. Oh sorry I didn't know you'd already implemented this one. If that's the case then obviously let's just go with yours as I assume it's cleaner than mine and more in line with your style.

@daniel1noble
Copy link
Owner

Lokos ok to merging

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.

2 participants