多组折线图+分层
gapminder<-read.csv("gapminder.csv",header = T)
library(ggplot2)
p <- ggplot(data = gapminder,
            mapping = aes(
                x = year, 
                y = lifeExp,
                group = country))
p1<-p + geom_line() + 
    facet_wrap(~ continent)
p1
p2.1<- p1+
    geom_hline(yintercept =40,linetype=2)+
    geom_hline(yintercept =60,linetype=2)+
    theme_bw() +
    theme(panel.grid.major = element_blank(), 
          panel.grid.minor = element_blank(),
          axis.text = element_text(size=8, face = "bold"),
          strip.text = element_text(size = 10, face = "bold"))
p2.1
          
p1<-p + geom_line() + 
    geom_point() +
    facet_wrap(~ continent)
p1
p2.2<- p1+
    geom_hline(yintercept =40,linetype=2)+
    geom_hline(yintercept =60,linetype=2)+
    theme_bw() +
    theme(panel.grid.major = element_blank(), 
          panel.grid.minor = element_blank(),
          axis.text = element_text(size=8, face = "bold"),
          strip.text = element_text(size = 10, face = "bold"))
p2.2
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇