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".

The package provides

geoms filled with various patterns. Includes a patterned version of every geom that has a region that can be filled with a pattern. Provides a suite of aesthetics and scales for controlling pattern appearances. Supports over a dozen builtin patterns (every pattern implemented by {gridpattern}) as well as allowing custom user-defined patterns.

An overview and introduction to the package can be found on the package website

31 questions
0
votes
1 answer

Ggplot with multiple factors: How to implement pattern in the legend?

I managed to have quite nice legends for the first two parameters, but the third legend does not want to pop up as intended. I would like to see the pattern with black filling in the third legend element that describes the sequences. Here an…
SDahm
  • 474
  • 2
  • 9
  • 21
0
votes
0 answers

ggpattern, where to find the options for patterns?

Where can I find the options? I have tried everything: "triangle", "dot", "square", it doesn't like any of them, I can only get stripe, circle, wave and weave to work. Thanks
Cathyt10
  • 71
  • 8
0
votes
2 answers

Substitute color with patterns (stripes, lines) in bar ggplot - clustered data

I am trying to do a bar plot for grouped data, where each group has a pattern. Colors look rather ugly so I have tried substituting it with a pattern. My data looks like this : Time <- c(1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6, 6, 6, 6, 11,…
0
votes
0 answers

ggpattern::geom_rect_pattern is very slow

The code below is very slow (and possibly does not even run - I have not waited for it to finish yet). Is there a way of speeding it up? library(ggpattern); library(ggplot2) diamonds %>% ggplot(aes(price, fill = cut)) + …
luciano
  • 13,158
  • 36
  • 90
  • 130
0
votes
1 answer

Arrangement of bars with ggplot2 / ggpattern

I have problems with the arrangement of bars in ggplot2 using additionally the package ggpattern. This is my data: # reqired packages library(tibble) library(ggplot2) library(ggpattern) # example data data <- tibble::tribble(~time, ~origin,…
Marie Veit
  • 27
  • 5
0
votes
0 answers

Use crosshatch as filling for a shapefile that is on top of a raster with ggpattern

I am plotting a shape file on top of a raster using ggplot2. I would want my shape file to be filled with a transparent crosshatch. I read about the ggpattern package and tried using it but can not figure it out, especially because I am plotting…
nisai
  • 1
  • 2
0
votes
1 answer

Is there a way to add stripes to bar graphs in ggplot2?

I have six sites that I want to make into bar graphs, with site name on the x-axis and rates (numbers) on my y-axis. My sites are Site 1, Site 1 Hardwood, Site 2, Site 2 Hardwood, Site 3, Site 3 Hardwood. I would like the bars for the Hardwood sites…
Kynareth
  • 3
  • 2
0
votes
1 answer

Plot violin plot with multiple pattern

I want a violin plot with 4 violin, 2 with striped pattern and 2 with no pattern. I only obtain striped pattern, can you help me please? gg <- ggplot(AdPluslong, aes(Eval, Total.Score)) + geom_violin_pattern(aes(fill =…
0
votes
1 answer

Unable to set distinct patterns for each variable using ggplot boxplot

I would like to set distinct patterns for my box and whisker plot variables. I have tried using scale_pattern_manual() but it is not setting distinct patterns for each variable and is setting a stripe pattern to all variables. DF2 <- data.frame( x…
Hazel
  • 1
0
votes
1 answer

Setting a pattern or symbol as NA value in geom_tile

I have data i want to visualise using geom_tile. The data deal with references in text data from either Germany or Spain to other European countries. Example data: data<- tribble( ~Ref_country, ~Country, ~Share, "ENG", "DE", 0.27, "ENG", "ES",…
0
votes
1 answer

How to give different pattern for side by side boxplots in R

My code is: ggplot(my_data, aes(x = factor(inst), y = value, fill = color)) + geom_boxplot(position = position_dodge(width = 0.75)) + scale_fill_manual(values = c("blue" = "blue", "green" = "green", "red" = "red", "yellow" = "yellow")) + …
Balina
  • 81
  • 5
0
votes
1 answer

How can I change colors by using ggpattern?

I have a Design of 2 different Treatments (1)MIA: Poly_IC/Saline, 2) Ethanol:1/0) . I would like to assign different colors to Ethanol and a pattern to MIA. While the pattern worked out fine. I have trouble with the color. Here is the code I…
0
votes
1 answer

How to get ggplot2 to use my specified colors?

I have data that pertains to chlorophyll-a biomass from two size classes of phytoplankton: 'WSW' and "<20 µm" size classes. The data is also divided by regions of the Gulf of Mexico (5 in total). Each region has both WSW and <20 µm values. I am…
0
votes
1 answer

ggpattern - removing legend , custom pattern color

here's a data frame as example. library(tidyverse) library(ggpattern) dat <- data.frame(drv = c("4", "4", "4", "4", "4", "f", "f", "f", "f", "r", "r", "r"), class = c("compact", "midsize", "pickup", "subcompact", "suv", …
HMK
  • 47
  • 4
0
votes
2 answers

Why do the stripes only appear on legend and not on plot itself?

Trying to use ggpattern for this plot but can't get it to work right. Legend looks okay doesn't translate to what's on plot itself. Not stripes or dots on actual plot? test <- tibble(names = c("fred", "harry", "tom"), start = c(1, 3,…