R_Primary y轴未显示轴标签

时间:2020-05-28 13:59:41

标签: r plot axis-labels plotrix

由于其具有辅助y轴的功能,我试图使用plotrix::twoord.plot函数在一个图中绘制两个时间序列。但是,由于某些原因,它没有在主要y轴上显示轴值。

twoord.plot(lx=trd.df$Index, ry=trd.df$Dis, ly=trd.df$Prec, rx=trd.df$Index,
            type="l",lcol="blue", rcol="red",ylab="Precipitation [mm/hr]", 
            rylab="Discharge[m3/s]",do.first="plot_bg()")

上面的代码给了我这个 enter image description here

如您所见,主要y轴上的刻度线没有值。根据{{​​1}}的范围,我认为可以在trd.df$Prec上添加标记和标签,因此我尝试在上述代码中添加1:6参数

lytickpos

但是,这给出了

enter image description here

我在做什么错了?

我的数据twoord.plot(lx=trd.df$Index, ry=trd.df$Dis, ly=trd.df$Prec, rx=trd.df$Index, type="l",lcol="blue", rcol="red",ylab="Precipitation [mm/hr]", rylab="Discharge[m3/s]",do.first="plot_bg()", lytickpos =1:6)

trd.df

0 个答案:

没有答案