【发布时间】:2020-03-31 11:40:08
【问题描述】:
我正在尝试制作一个图表,其中 x 轴上有不同的区域,y 轴上有平均案例。当我尝试绘制此图时,即使我使用了函数pch = 和type = p,我也会得到每个点的实心条。这是我的代码
plot(region1_data$Zone, region1_data$total_cases,
type = "p",
pch = 21,
bg = "#035DAB",
cex=2,
srt=45,
ylim = c(0,550),
ylab = "",
xlab = "",
yaxt = "n",
xaxt ="n")
mtext(side = 1, text = "Zone", line = 5)
Axis(side = 1,
at = region1_data$Zone,
labels = region1_data$Zone,
tick = TRUE, las = 2,
srt = 60,
adj= 1)
我想要的是 4 个点,其中有一条线穿过它们,它们具有相同的颜色,随着 y 值的增加而改变透明度。我试过制作一个新的向量来做这样的事情......
pch = region1_data$Zone
pch = as.numeric(pch)
但这也不起作用。谁能告诉我如何做到这一点
【问题讨论】:
标签: r plot graph scatter-plot alpha