Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个模拟示例:
a<-seq(1:5) barplot(a)
现在我希望条形图从轴 3(顶部)悬垂而不是从轴 1 上升(在任何 plot(a) 函数中看到的正常 x 轴。(这也可以用于任何其他图) , 我想)。
这个想法是让降水数据挂在我的绘图顶部,y 轴在我的图表右侧。
我该怎么办?
谢谢你的任何建议。
用于barplot(a, ylim = rev(range(c(0, a))))使您的图表从上到下。
barplot(a, ylim = rev(range(c(0, a))))
您可以使用yaxt = "n"和axis()在右侧绘制轴。
yaxt = "n"
axis()
barplot(a, ylim = rev(range(a)), yaxt = "n") axis(4, at = a)
这是上一个示例的输出: