trevorld / ggpattern

ggplot geoms with pattern fills
https://trevorldavis.com/R/ggpattern/dev/
Other
356 stars 18 forks source link

[BUG] #77

Closed qkdrk7777775 closed 2 years ago

qkdrk7777775 commented 2 years ago

I tried running the example, but it did not work properly because the following error occurred in the Windows operating system.

example

image

This error seems to be due to "pattern_type='tile'". How can I fix the error?

flags <- c(
  system.file("img", "flag", "au.png", package = "ggpattern"),
  system.file("img", "flag", "dk.png", package = "ggpattern"),
  system.file("img", "flag", "gb.png", package = "ggpattern"),
  system.file("img", "flag", "gr.png", package = "ggpattern"),
  system.file("img", "flag", "no.png", package = "ggpattern"),
  system.file("img", "flag", "se.png", package = "ggpattern"),
  system.file("img", "flag", "us.png", package = "ggpattern")
)

ggplot(data=data,
    aes(x=cut,y=per,pattern_filename =clarity))+
    geom_col_pattern(width = 2,
        stat="identity",position=position_dodge(),
        fill='white',colour='black',
        pattern='image',pattern_type='tile')+
    theme(legend.position = 'none')+
    scale_pattern_filename_discrete(choices = flags)

image

image

trevorld commented 2 years ago