99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
2018-11-02 閱讀量: 974
ggplot2里的坐標(biāo)系

坐標(biāo)系可能是 ggplot2 中最復(fù)雜的部分。默認(rèn)的坐標(biāo)系是笛卡兒直角坐標(biāo)系,可以通過(guò)其

獨(dú)立作用的 x 坐標(biāo)和 y 坐標(biāo)找到每個(gè)數(shù)據(jù)點(diǎn)。偶爾也會(huì)用到一些其他類型的坐標(biāo)系。

coord_flip() 函數(shù)可以交換 x 軸和 y 軸。當(dāng)想要繪制水平箱線圖時(shí),這非常有用。它也

非常適合使用長(zhǎng)標(biāo)簽,但要想在 x 軸上不重疊地安排好它們是非常困難的:

ggplot(data = mpg, mapping = aes(x = class, y = hwy)) +
geom_boxplot()
ggplot(data = mpg, mapping = aes(x = class, y = hwy)) +
geom_boxplot() +
coord_flip()

coord_quickmap() 函數(shù)可以為地圖設(shè)置合適的縱橫比。當(dāng)使用 ggplot2 繪制空間數(shù)據(jù)時(shí),

這個(gè)函數(shù)特別重要:

nz <- map_data("nz")
ggplot(nz, aes(long, lat, group = group)) +
geom_polygon(fill = "white", color = "black")
ggplot(nz, aes(long, lat, group = group)) +
geom_polygon(fill = "white", color = "black") +
coord_quickmap()

coord_polar() 函數(shù)使用極坐標(biāo)系。極坐標(biāo)系可以揭示出條形圖和雞冠花圖間的一種有

趣聯(lián)系:

bar <- ggplot(data = diamonds) +
geom_bar(
mapping = aes(x = cut, fill = cut),
show.legend = FALSE,
width = 1
) +
theme(aspect.ratio = 1) +
labs(x = NULL, y = NULL)
bar + coord_flip()
bar + coord_polar()
0.0000
2
關(guān)注作者
收藏
評(píng)論(0)

發(fā)表評(píng)論

暫無(wú)數(shù)據(jù)
推薦帖子