r 图表:R(语言):点数,线:生产,销售,投资

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了r 图表:R(语言):点数,线:生产,销售,投资相关的知识,希望对你有一定的参考价值。

#!/usr/bin/env R

Q1 <- c(2, 4, 5, 7, 12, 14, 16)
Q2 <- c(3, 6, 7, 8, 9, 11, 12)
Q3 <- c(1, 7, 3, 2, 2, 7, 9)
yaxismax <- max(Q1, Q2, Q3)
plot(
  Q1,
  pch = 16,
  type = "b",
  col = "midnightblue",
  ylim = c(0, yaxismax),
  axes = FALSE,
  ann = FALSE
)
axis(
  1,
  at = 1:7,
  lab = c("A", "B", "C", "D", "E", "F", "G")
)
axis(
  2, 
  las = 1, 
  at = 4 * 0:yaxismax
)
box()
lines(
  Q2,
  pch = 17,
  type = "b",
  lty = 2,
  col = "firebrick4"
)
lines(
  Q3,
  pch = 18,
  type = "b",
  lty = 3,
  col = "darkolivegreen4"
)
title(
  main = "Production, Sales and Investment",
  col.main = "darkgreen",
  font.main = 2)
title(xlab = toupper("Project Phases"), col.lab = "maroon4")
title(ylab = "Millions", col.lab = "tomato4")
legend(
  1, yaxismax,
  c("Q1", "Q2", "Q3"),
  cex = 0.8,
  col = c("midnightblue", "firebrick4", "darkolivegreen4"),
  pch = c(16, 17, 18),
  lty = 1:3
)

以上是关于r 图表:R(语言):点数,线:生产,销售,投资的主要内容,如果未能解决你的问题,请参考以下文章

r 图表:R(语言):点数,线数:向上趋势#3

r 图表:R(语言):点数,线数:向上趋势#3

一周内教会您用R语言挖掘公共数据库(TCGAGEO)发表文章 9月21-25日 线上班

r语言矩阵转为图表

什么是R/3系统

R语言低级绘图函数-grid