Merged
Conversation
hadley
approved these changes
Mar 23, 2022
schloerke
added a commit
to schloerke/ggplot2
that referenced
this pull request
Mar 23, 2022
* master: (320 commits) Orientation-aware key glyphs (tidyverse#4757) Fix warning in geom_violin with draw_quantiles (tidyverse#4654) Fix misalignment in geom_dotplot when stackratio != 1 and stackdir != "up" (tidyverse#4734) Replace coord_equal in scale-identity.r (tidyverse#4759) Unified message format in `geom_smooth()` (tidyverse#4634) Add parentheses to mentions of binned_scale in scale-alpha and scale-viridis documentation (tidyverse#4735) Update geom-boxplot.r (tidyverse#4744) Remove unneeded backslash from diamonds docs (tidyverse#4711) Re-document Warn on unsupported geoms in annotate() (tidyverse#4721) Re-document Add Trump to presidential terms dataset (tidyverse#4702) Corrects bins / binwidth override documentation (tidyverse#4720) Update infrastructure to new best practices (tidyverse#4748) remove stringsAsFactor for the mapped_discrete as.data.frame method (tidyverse#4750) Workflow updates (tidyverse#4747) Ensure output is numeric even if ifelse clause is NA (tidyverse#4692) Add non_missing_aes to geom_tile (tidyverse#4683) Pass on binwidth and height to geom (tidyverse#4671) Check for range == NULL - happens if no data has been added to plot (tidyverse#4682) ...
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR closes #4732 by providing orientation-aware key glyphs for
geom_boxplot(),geom_crossbar(),geom_pointrange(), andgeom_linerange().For example, before these changes:
Created on 2022-03-15 by the reprex package (v2.0.1)
After these changes:
Specifically, this PR:
draw_key_boxplot(),draw_key_crossbar(), anddraw_key_pointrange()to be orientation-awaredraw_key_linerange(), which is an orientation-aware version ofdraw_key_path()(becausedraw_key_path()is used by other geoms whose legends should not be orientation-aware, I could not simply makedraw_key_path()orientation aware).geom_linerange()to bedraw_key_linerange()instead ofdraw_key_path().and verticallegends.This might be too many graphical tests; I'm happy to reduce them --- perhaps by removing the vertical tests (the old behavior) and just leaving the horizontal ones.I have condensed the visual tests down to just two for horizontal legends; I'm not sure there's a clear way to reduce them to fewer.This PR does not add orientation-aware key glyphs to
geom_errorbar()orgeom_errobarh(), as these geoms consist of both horizontal and vertical lines, so it seemed reasonable to leave them as is. In fact,geom_errorbarh()already has the same key glyph asgeom_errorbar()rather than one of the opposite orientation, corroborating my sense that the legends for these two geoms do not need to be orientation-aware.