[英]Add Space Between Panels of Openair windRose Plots
我使用openair
package 創建了一些 windrose 圖,我對它們的結果非常滿意,但從美學上講,面板之間有一些空間會很好。 這是一個例子:
# 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)
)
有人對如何在面板之間增加空間有任何想法嗎?
經過一番挖掘后,我發現這個 plot function 使用格子圖,這里有一個很好的概述: https://www.stat.auckland.ac.nz/~ihaka/787/lectures-trellis.pdf
具體來說, xyplot
function 用於創建網格?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)
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.