【问题标题】:Add Space Between Panels of Openair windRose Plots在 Openair windRose 绘图面板之间添加空间
【发布时间】:2020-12-23 20:11:14
【问题描述】:

我使用openair 包创建了一些风玫瑰图,我对它们的结果非常满意,但从美学上讲,在面板之间留一些空间会很好。这是一个例子:

# windrose plot----
library(openair)
data("mydata")

windRose(mydata[1:144,], ws="ws", wd="wd", 
         paddle = F, 
         type = 'weekday', 
         key.header = 'Wind Speed (m/s)',
         key.footer = "",
         annotate = F,
         angle = 30, # angle of "spokes"...sort of bins for wind direction
         cols =  'jet',
         key.position = 'right',
         dig.lab = 2,
         statistic = 'prop.count', #“prop.count” sizes bins according to the 
         # proportion of the frequency of measurements
         fontsize = 20,
         grid.line = 100,
         max.freq = 105, # maximum value for the radial limits
         key = list(header = "Wind Speed (m/s)",
                    footer = '',
                    labels = c('0 to 2', '2 to 4', 
                               '4 to 6','6 or more'),
                    breaks = c(0,2,4,6)),
         layout = c(6,1)
)

有人知道如何在面板之间添加空间吗?

【问题讨论】:

    标签: r openair


    【解决方案1】:

    经过一番挖掘,我发现这个绘图函数使用格子图,这里有一个很好的概要:https://www.stat.auckland.ac.nz/~ihaka/787/lectures-trellis.pdf

    特别是xyplot 函数用于创建格状图。 ?xyplot 的帮助文档显示您可以调整参数between 以实现面板之间的间距。 between 参数是一个列表,其中包含代表面板之间空间的 x 和 y 值。因此我们可以简单地通过添加参数between = list(x=0.25, y = 0.25)来调整上面的代码,并且可以像这样调整x和y到我们的偏好:

    library(openair)
    data("mydata")
    
    windRose(mydata[1:144,], ws="ws", wd="wd", 
             paddle = F, 
             type = 'weekday', 
             key.header = 'Wind Speed (m/s)',
             key.footer = "",
             annotate = F,
             angle = 30, # angle of "spokes"...sort of bins for wind direction
             cols =  'jet',
             key.position = 'right',
             dig.lab = 2,
             statistic = 'prop.count', #“prop.count” sizes bins according to the 
             # proportion of the frequency of measurements
             fontsize = 20,
             grid.line = 100,
             max.freq = 105, # maximum value for the radial limits
             key = list(header = "Wind Speed (m/s)",
                        footer = '',
                        labels = c('0 to 2', '2 to 4', 
                                   '4 to 6','6 or more'),
                        breaks = c(0,2,4,6)),
             layout = c(6,1),
             between = list(x=0.25, y=0.25)
    )
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-06
      • 2013-10-30
      • 2022-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-29
      • 2022-11-11
      相关资源
      最近更新 更多