gpt4 book ai didi

r - R中XY图上的多轴/刻度

转载 作者:行者123 更新时间:2023-12-02 06:21:14 25 4
gpt4 key购买 nike

如何使用 plot() 在 XY 图中绘制第二条线,以不同的比例(如本例(紫色线))?

enter image description here

第一行(红色)我的 R 代码是这样的:

p <- sqlQuery(ch,"SELECT wl,param1 FROM qryPlot ORDER BY wl")
plot(p$wl,p$param1,axes=T,xlim=c(400,800),ylim=c(0,100),type="l",col="red")

最佳答案

总体思路如下:

plot(1:10)
par(new=T)
plot(1:10, rep(50, 10), type='l', axes=F, xlab=NA, ylab=NA)
axis(4)

enter image description here

关于r - R中XY图上的多轴/刻度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9162498/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com