R2-26-第一期-ggplot2画散点图/折线图作业

郑磊 2017-11-02 14:10:56 阅读: 907

hw2.1 <- read.table(file ="data/R2-1-1.csv", sep = ",", header = TRUE)

hw2.2 <- read.table(file ="data/R2-1-2.csv", sep = ",", header = TRUE)

#load package

library(ggplot2)

#graph 1

ggplot(hw2.1, aes(x = A, y = B, colour = SIZE), )+ geom_point()+ 

  geom_point(shape=21,size = 4, fill="white") + 

  xlim(-2, 3) + 

  ylim(-1,3) +

  ggtitle("R2-26-Leo") + 

  theme(panel.grid.major = element_blank(),

        panel.grid.minor = element_blank(),

        panel.border = element_blank(),

        panel.background = element_rect(fill="white"),

        axis.line = element_line(colour="black"))

R2-26-Leo-1.png


#graph2

ggplot(hw2.2, aes(x = Time, y = value, colour = SIZE, shape = SIZE)) + 

  geom_line() + 

  ggtitle("R2-26-Leo") +

  geom_point(size=2.5)+ 

  theme(panel.grid.major = element_blank(),

        panel.grid.minor = element_blank(),

        panel.border = element_blank(),

        panel.background = element_rect(fill="white"),

        axis.line = element_line(colour="black"))

R2-26-Leo-2.png

 
邀请讨论

附件

{{f.title}} 大小 {{f.file_size}} 下载 {{f.count_download}} 金币 {{f.count_gold}}
{{item.nick_name}} 受邀请回答 {{item.create_time}}
{{item.refer_comment.nick_name}} {{item.refer_comment.create_time}}

附件

{{f.title}} 大小 {{f.file_size}} 下载 {{f.count_download}} 金币 {{f.count_gold}}
切换到完整回复 发送回复
赞({{item.count_zan}}) 踩({{item.count_cai}}) 删除 回复 关闭
科研狗©2015-2024 科研好助手,京ICP备20005780号-1 建议意见

服务热线

178 0020 3020

微信服务号