我必须绘制两个连续的时间序列,每个轴需要独立的比例尺。
但是,我的代码不起作用:
ggplot()+
geom_line(t, mapping = aes(y = EMBIG, x = Date), colour = "blue")+
geom_line(t, mapping = aes(y = VIX, x = Date), colour = "red")+
scale_y_continuous(name = "EMBIG", breaks = NULL,
sec.axis = dup_axis(name = "VIX"))
您有什么建议吗?同样在ggplot之外是一个解决方案