如何控制ggpattern的填充图案的宽度
我想减小 ggpattern 的填充图案的宽度,使其看起来像黑色斜线。但是,我的脚本不起作用。
library(ggplot2)
library(ggpattern)
ggplot(sf_poly) +
geom_sf_pattern(pattern_fill = "transparent", fill = "transparent",
# pattern = 0,
pattern_size = 0.2,
pattern_type = 3,
color = "transparent",
size = 0.2)
I want to decrease the width of ggpattern
's fill pattern, making it looks like a black oblique line. However, my script did not work.
library(ggplot2)
library(ggpattern)
ggplot(sf_poly) +
geom_sf_pattern(pattern_fill = "transparent", fill = "transparent",
# pattern = 0,
pattern_size = 0.2,
pattern_type = 3,
color = "transparent",
size = 0.2)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 packages "stripe" vignette 您可以使用
pattern_密度
美学控制图案填充的区域,即在这种情况下,较低的pattern_密度
值将减小条纹的宽度。或者,减少pattern_spacing
将增加条纹数量,这也会减少固定pattern_密度
值的条纹宽度(填充给定区域的条纹越多意味着每个条纹必须更小)。According to the packages "stripe" vignette you can use the
pattern_density
aesthetic to control the area the pattern fills i.e. in this case a lowerpattern_density
value will decrease the width of the stripes. Alternatively decreasingpattern_spacing
will increase the number of stripes which would also reduce the stripe width for a fixedpattern_density
value (more stripes filling a given area means each stripe must be smaller).