[英]Add Space Between Panels of Openair windRose Plots
I created some windrose plots using the openair
package and I'm pretty happy with how they turned out but aesthetically it would be nice to have some space between panels.我使用
openair
package 创建了一些 windrose 图,我对它们的结果非常满意,但从美学上讲,面板之间有一些空间会很好。 Here's an example:这是一个例子:
# 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)
)
Anyone have any ideas of how to add space between the panels?有人对如何在面板之间增加空间有任何想法吗?
After some digging I found that this plot function utilizes trellis plots, here is a good rundown on them: https://www.stat.auckland.ac.nz/~ihaka/787/lectures-trellis.pdf经过一番挖掘后,我发现这个 plot function 使用格子图,这里有一个很好的概述: https://www.stat.auckland.ac.nz/~ihaka/787/lectures-trellis.pdf
Specifically the xyplot
function is used to create the trellis plot. The help documentation for ?xyplot
shows that you can adjust the argument between
to achieve spacing between panels.具体来说,
xyplot
function 用于创建网格?xyplot
的帮助文档显示您可以调整参数between
以实现面板之间的间距。 The between
argument is a list containing x and y values that represent space between panels. between
参数是一个列表,其中包含表示面板之间空间的 x 和 y 值。 Therefore we can adjust the above code simply by adding the argument between = list(x=0.25, y = 0.25)
and can adjust x and y to our preference like this:因此我们可以简单地通过添加参数
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)
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.