[英]How to put two y-axis with different scale on the same side of the plot with ggplot?
I have three variables (Precipitation, Temperature and PAR Radiation) with different scales.我有三个不同尺度的变量(降水、温度和 PAR 辐射)。 I'm trying to plot these three variables together and I put the daily sum of precipitation represented by a barplot on the left side y axis and the daily average of temperature on the right side y axis.
我试图将这三个变量绘制在一起,并将条形图表示的日降水量总和放在左侧 y 轴上,将每日平均温度放在 y 轴上。 I'd like to put another y axis on the right side, with another scale, in order to represent the daily average of PAR radiation, but I can't.
我想在右侧放置另一个 y 轴,使用另一个刻度,以表示 PAR 辐射的日平均值,但我不能。 I'm using the ggplot package, because it is useful for other reasons.
我正在使用 ggplot 包,因为它因其他原因而有用。
I'm trying to reach something similar as in the pic:我试图达到与图片类似的东西:
A discussion of this topic can be found here: 可在此处找到有关此主题的讨论:
ggplot with 2 y axes on each side and different scales ggplot,每侧有2个y轴,不同的刻度
A workaround solution can be found here: 可在此处找到变通方案解决方案:
https://rpubs.com/MarkusLoew/226759 https://rpubs.com/MarkusLoew/226759
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.