Description Usage Arguments Format Value Examples
Simple feature style Rose Map
1 2 3 4 5 6 |
mapping |
mapping |
data |
data |
translate |
translate, must be two numbers. The first number is given to move along x-axis, the other is y-axis |
rotate |
rotate |
mirror |
mirror, must be two numbers. The first number is slope, the other is intercept |
mirror_h |
one number, mirror refelct by horizontal line |
mirror_v |
one number, mirror refelct by vertical line |
zoom |
one number |
position |
position |
na.rm |
na.rm |
show.legend |
show.legend |
inherit.aes |
inherit.aes |
... |
passed to params |
An object of class StatSf
(inherits from Stat
, ggproto
, gg
) of length 4.
Simple feature picture
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | librar(ggrose)
dd=nCov2019()
dd2=rose_data(dd)
# original data
ggplot(data = dd2)+
sf_rose()
# add petal
ggplot(data = dd2)+
sf_rose(aes(petal=diagnose))
# add petal
# transform diagnose to log10
ggplot(data = dd2)+
sf_rose(aes(petal=log10(diagnose)))
# add color
ggplot(data = dd2)+
sf_rose(aes(fill=log10(diagnose)))
# use color and petal together
ggplot(data = dd2)+
sf_rose(aes(fill=log10(diagnose),
petal=log10(diagnose)))
# plot two roses and translate the second 1.6 anlong x-axis
ggplot(data = dd2)+
sf_rose(aes(petal=log10(diagnose)))+
sf_rose(aes(petal=log10(diagnose)),
translate = c(1.6,0))
# rotate
ggplot(data = dd2)+
sf_rose(aes(fill=log10(diagnose),
petal=log10(diagnose)),
rotate = 90)
# mirror reflecte
ggplot(data = dd2)+
sf_rose(aes(petal=log10(diagnose)))+
sf_rose(aes(petal=log10(diagnose)),
translate = c(1.6,0),fill='blue',
mirror_v = 2)
# zoom
ggplot(data = dd2)+
sf_rose(aes(petal=log10(diagnose)))+
sf_rose(aes(petal=log10(diagnose)),
translate = c(1.6,0),fill='blue',
zoom=0.5
)
# mirror reflecte and regulate start angle
ggplot(data = dd2)+
sf_rose(aes(petal=log10(diagnose)),rotate = -30)+
sf_rose(aes(petal=log10(diagnose)),rotate = -30,
translate = c(2,0),fill='blue',
mirror_v = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.