1
是否有直接的方法将第二个Y轴添加到图表模型?我看到linePlusBar图表具有此功能(通过y1Axis
y2Axis
和forceY
),但有没有简单的方法将其添加到其他模型?我想将它用于lineChart或scatter模型。添加第二个Y轴
是否有直接的方法将第二个Y轴添加到图表模型?我看到linePlusBar图表具有此功能(通过y1Axis
y2Axis
和forceY
),但有没有简单的方法将其添加到其他模型?我想将它用于lineChart或scatter模型。添加第二个Y轴
同一个X轴,不同的Y值需要双Y轴。你可以试试这个:
plot(x,y1......,axes=F)
axis(2,....) # build the left Y axis
par(new=T) # means that the next chart will be draw on the picture you draw above
plot(x,y2......,axes=F)
axis(4,....) # build the right Y axis