Questions tagged [ggpattern]
Use this tag for questions related to the ggpattern package. The ggpattern package is an extension package for {ggplot2} which "provides geoms filled with various patterns".
ggpattern
48
questions
1
vote
3
answers
83
views
Merge the legend from ggpattern and ggplot2
I have a world map where countries are colored and some colors also have stripes (so that it is ready when printed in black and white).
I managed to add the stripes using the package ggpattern, but I ...
1
vote
1
answer
37
views
Maps & scale_*_manual for multiple geom types (geom_polygon & geom_pattern_polygon)
I am trying to create a map where only counties with missing data have a striped pattern. Ideally, the background of this pattern would be white and the stripes would be blue, but I have gotten ...
0
votes
1
answer
40
views
create legend from ggpattern
I have created a map that iterates through counties and adds a color and a pattern based on the great ggpattern r package, however I cannot figure out how to create a legend to add to the map with the ...
0
votes
0
answers
26
views
Combine ggpubr and ggpattern packages
Has someone ever found a way to fill bareplot with stripes in ggbarplot (ggpubr package, one example below), using for example ggpattern package ?
Thanks !
data <- mtcars
data$cars <- rownames(...
1
vote
1
answer
63
views
Cross hatches with ggplot2
I'm trying to make a bar plot, and for the treatments that include insecticide, I want there to be cross hatches, but the code I currently won't work and I cannot figure out how to fix it.
Here is a ...
1
vote
1
answer
80
views
Add texture/pattern to only one bar in ggplot
I am trying to modify the texture of only one bar and I am having issues in the legend.
Here is my data and code
Run3VsRun8_Savings <- data.frame(
Category = factor(c("4", "5",...
0
votes
1
answer
54
views
How do you remove pattern_fill legend?
I'm wondering how and if it's possible to remove the legend created by pattern_fill?
This is my data:
#To use non-english characters
Sys.setlocale("LC_ALL", "nb-NO.UTF-8")
library(...
1
vote
1
answer
43
views
ggplot2 & ggpattern: How to specify legend columns/rows when fill and pattern are cobined?
In the following example, I use both pattern and fill. The legend has to be below the plot. How can force the legend in one row?
I can't get guides(fill=guide_legend(nrow=1)), as used here, to work.
...
0
votes
1
answer
172
views
Not compilation when labelling x-axis ggplot2
I have a dataset with two facors (f1 and f2) and two responses (r1 and r2). For the f1, I although in the dataset it is coded with A, B, C, etc, I want to use specific names. However, when I tray to ...
0
votes
1
answer
133
views
Changing legend title in ggpattern R
So I am trying to visualize my data in R using the ggpattern package. The problem is that I can't seem to edit the legend's title using the guides function. Before I go further into that, let me show ...
0
votes
1
answer
131
views
Different pattern and colors two-way ANOVA barplot
I´m plotting two factors and two variables in the same graph. However, I want that the factor time not only appears each bar with a different color, but also with a different pattern (using ggpattern)....
0
votes
0
answers
83
views
Removing part of the legend in ggplot2
I have an overlapping of three stat_contour_filled functions using also ggpattern (you can see the "background" in my previous question). Here is my code:
v<-ggplot(df, aes(pi1,pi2,z=val))...
0
votes
1
answer
98
views
Manually changing the filling color in the legend of my R! ggplot boxplot
I have trouble to visualize the pattern distinction in my R! boxplot, for which I've used ggplot & ggpattern. I want to show the white stripes for the condition "s". But since the ...
1
vote
1
answer
248
views
Patterns in filled contours and striped colors in R
Let me introduce you my big problem: I have to create two filled contour graphs and then overlap them in order to show where intersections happen. In order to be clear, I'd need to use "stripes&...
0
votes
1
answer
360
views
changing line angle in scale_pattern_manual in ggplot
I would like change the patterns in my stacked barchart using scale_pattern_manual to have the last stack in my stacked barchart have vertical lines instead of horizontal 45 degrees. So I want them to ...