R绘制多姿多彩的曲线图demo

x.text <- c('1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月')
sales.1 <- c(49.9,71.5,106.4,129.2,144,176,135.6,148.5,216.4,194.1,95.6,54.4)
sales.2 <- c(83.6,78.8,98.5,93.4,106.0,84.5,105,104.3,91.2,83.5,106.6,92.3)
sales.3 <- c(48.9,38.8,39.3,42.4,47,48.3,62,59.6,52.4,65.2,59.3,53)
sales.4 <- c(42.4,33.2,34.5,39.7,52.6,70.5,57.4,62,47.6,39.1,46.8,51.1)
id <- c('帆布鞋','T恤','皮包','冲锋衣')
col <-c('green','yellow','brown','gray')
plot(sales.1,type = 'b',xaxt='n',ylim = c(0,300),col=col[1],main = '月销量趋势图',xlab = '月份',ylab = '销量(万)')
axis(1,at=1:12,labels = x.text,tick = FALSE)
legend('topleft',legend = id,horiz = T,pch=15,col=col,cex=0.8,bty='n')
grid(nx=NA,ny=8,lwd=1,lty=2,col='skyblue')

lines(sales.2,type = 'b',col=col[2])
lines(sales.3,type = 'b',col=col[3])
lines(sales.4,type = 'b',col=col[4])

在这里插入图片描述

col <-c('black','blue','blueviolet','aquamarine')

在这里插入图片描述

col <-c('burlywood','cadetblue','chartreuse','chocolate')

在这里插入图片描述

col <-c('cornflowerblue','cyan','darkblue','darkcyan')

在这里插入图片描述

col <-c('darkgreen','darkkhaki','darkmagenta','darkolivegreen')

在这里插入图片描述

col <-c('darkorange','darkorchid','darkred','darksalmon')

在这里插入图片描述

col <-c('darkslateblue','darkslategray','darkturquoise','darkviolet')

在这里插入图片描述

col <-c('deeppink','deepskyblue','dodgerblue','firebrick')

在这里插入图片描述

col <-c('forestgreen','gold','goldenrod','green')

在这里插入图片描述

col <-c('greenyellow','hotpink','indianred','khaki')

在这里插入图片描述

col <-c('yellowgreen','yellow','violet','turquoise')

在这里插入图片描述

col <-c('tomato','thistle','tan','steelblue')

在这里插入图片描述

col <-c('springgreen','slategray','slateblue','skyblue')

在这里插入图片描述

col <-c('sienna','seagreen','sandybrown','salmon')

在这里插入图片描述

col <-c('saddlebrown','royalblue','rosybrown','red')

在这里插入图片描述

col <-c('purple','powderblue','plum','pink')

在这里插入图片描述

col <-c('peru','peachpuff','papayawhip','palevioletred')

在这里插入图片描述

col <-c('paleturquoise','palegreen','palegoldenrod','orchid')

在这里插入图片描述

col <-c('orangered','orange','olivedrab','navy')

在这里插入图片描述

col <-c('mediumspringgreen','midnightblue','mediumvioletred','mediumturquoise')

在这里插入图片描述

col <-c('mediumslateblue','mediumseagreen','mediumpurple','mediumorchid')

在这里插入图片描述

col <-c('mediumblue','mediumaquamarine','maroon','magenta')

在这里插入图片描述

col <-c('limegreen','lightsteelblue','lightskyblue','lightseagreen')

在这里插入图片描述

col <-c('lightsalmon','lightpink','lightgreen','lightcoral')

在这里插入图片描述

col <-c('lightblue','lawngreen','hotpink','greenyellow')

在这里插入图片描述
参考文献:https://blog.csdn.net/weixin_46587777/article/details/124973766
开发工具:RStudio 2022.12.0
微信Alt+A截屏工具

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值