Skip picking a scale when the layer data is Inf#3192
Merged
yutannihilation merged 5 commits intotidyverse:masterfrom Mar 20, 2019
Merged
Skip picking a scale when the layer data is Inf#3192yutannihilation merged 5 commits intotidyverse:masterfrom
yutannihilation merged 5 commits intotidyverse:masterfrom
Conversation
Member
|
What happens when all layers satisfy this condition? |
Member
Author
|
I was thinking about that... I'm 90% sure it fails anyway, because it doesn't have a range. Am I missing something? library(ggplot2)
library(patchwork)
p <- ggplot() +
annotate("rect", xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf, fill = "black")
p / p + xlim(0, 1) + ylim(0, 1)Created on 2019-03-19 by the reprex package (v0.2.1) |
Member
|
I can confirm that it fails for the current ggplot2, so the patch is probably fine. |
clauswilke
approved these changes
Mar 19, 2019
|
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Fix #3184
In ggplot2,
Infmight mean continuous value or discrete value. But, currently, the plot fails in the following caseInfIt seems better to skip picking a scale for the layer that has only infinite values. Note that, if all layers are such ones, the plot fails no matter we ignore them or not, because we cannot get a range for plots. So, I think this change is fine.