ggplot2 wind time series with arrows/vectors

后端 未结 2 1945
攒了一身酷
攒了一身酷 2020-12-17 22:45

From meteorological data (hourly values of temperature, wind and humidity) I managed to plot time series of wind speed and direction. Now I would like to add wind vectors on

2条回答
  •  [愿得一人]
    2020-12-17 22:51

    Compute the direction of the wind using decimal degrees. Assuming that you want 0 degrees to be North (up), use the following:

    ggplot(data = wind, aes(x=datetime, y=temp)) + 
      geom_text(aes(angle=-wind_dir_degrees+90), label="→")
    

提交回复
热议问题