由于其具有辅助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()")
如您所见,主要y轴上的刻度线没有值。根据{{1}}的范围,我认为可以在trd.df$Prec
上添加标记和标签,因此我尝试在上述代码中添加1:6
参数
lytickpos
但是,这给出了
我在做什么错了?
我的数据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