第六期作业-R011-绘图参数

blanking 2017-09-01 21:33:37 阅读: 1097

今天先交作业,有些问题,随后再改,老婆要生了,有点忙

  1. col设置颜色的函数:

    A:直接写颜色名字,颜色名及颜色见附件1: 颜色.pdf

BR预设调色板:rainbowheat.colorsterrain.colorstopo.colorscm.colors,具体颜色见附件2: 调色板.jpg

C:自定义调色板:colorRampPalette(c(“颜色1”,“颜色2))(n)

D: 灰度调色板:gray(0:n/n)

2.

x <- read.csv('/Users/taowang/documents/R/6.csv',header = F)

head(x)

a <- x$V1

b <- 5*sin(a) + 20

d <- 13*cos(a)-5*cos(2*a)-2*cos(3*a)-cos(6*a)

pdf(file = "/Users/taowang/documents/R/6-2.pdf")

plot(a, b, type = "l",col = "green", ylim = c(10,38),

     bty = "l",xlab = 'keyangou',cex = 2,ylab = "R", main = "I love keyan"

     )

points(a, d, col= "blue")

lines(x$V1,x$V2,type = "s",col = "red")

legend("topleft", legend = c("point1","line2","point3"),

       col = c("red","green","blue"),

       pch = c(NA,NA,1),

       lty = c(1,1,NA))

dev.off()

图见附件3: 6-2.pdf

 
邀请讨论

附件

{{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

微信服务号