Closed jvanbelzen closed 2 months ago
When I run the first example in my terminal I get:
and the second example looks like:
What graphic device are you drawing with? What does names(dev.cur())
give you?
This is a duplicate of #86 which remains open. I still need a minimal, reproducible example...
What graphic device are you drawing with? What does
names(dev.cur())
give you?
[1] "RStudioGD"
And it does only seem to be an issue for me when working in RStudio. Is ggpatterns() not compatible with RStudio?
{ggpattern}
in RStudio.options(bitmapType="cairo")
solved {ggplot2}
bugs in RStudio before. I think there is a way to customize what device you use in the GUI as well.{ggpattern}
fixes things. pattern_key_scale_factor
to adjust size of patterns in legends fixes things.And it does only seem to be an issue for me when working in RStudio. Is
{ggpatterns}
not compatible with RStudio?
I just installed RStudio on my Linux laptop and the charts work fine for me in RStudio.
I wildly speculate that maybe it is defaulting to the "quartz" device and maybe there is something weird going on the with the quartz png device which the "RStudioGD" device maybe wrapping around that doesn't affect the cairo png device?
You may want to click on "Tools" -> "Global Options" -> "Graphics" and try different graphics backends...
Bug description
Patterns appear in the graph, but not the legends. I noticed others described the same issue, but their problem seemed to be limited to exported image files. I have the issue in the image displayed in RStudio.
UPDATE The issue is specific to RStudio! If I run these same codes in R, the legend correctly displays the patterns.
Minimal, reproducible example
Two examples from independent posts (Stackoverflow and Posit). The responses indicate that the code produces the pattern in the graph and legends, as you would expect. However, when run on my end the same code produces the pattern in the graph but not the legend.
Session info