首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >添加Openair windRose绘图面板之间的间距

添加Openair windRose绘图面板之间的间距
EN

Stack Overflow用户
提问于 2020-12-24 04:11:14
回答 1查看 72关注 0票数 0

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

代码语言:javascript
复制
# 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)
)

有没有人知道如何在面板之间增加空间?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-29 03:54:40

经过深入研究,我发现这个绘图函数利用了网格绘图,下面是对它们的一个很好的概述: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,如下所示:

代码语言:javascript
复制
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)
)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65430365

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档