2017-05-05 8 views
0

テキストを折り返す方法を検索しています。 ---余白(バール、マージン)のエラー:未使用の引数(余白)ggplotでテキストをファセットグリッドラベルに折り返す方法

ここに私のコードの一部があります。 :

#simpson by protected status for domain FKNMS 
ggplot(data = fk_strata_abun_diversity, aes(x = YEAR)) + 
geom_point(aes(y = strata_simpson, color = "strata_simpson"),color = "blue") + 
geom_line(aes(y = strata_simpson, color = "strata_simpson"), color = "blue") + 
facet_grid(STRAT ~ protected_status, 
     labeller = labeller(.rows = strata_names, .cols = protected_status_names), 
     label_wrap_gen(width = 2)) + #error: in margins(vars, margins) : unused argument (margins) ?? 
labs(x = "Year", y = "Effective Number of Species") + 
ggtitle("Simpson Diveristy of Reef Fish in the Florida Keys by Strata") + 
theme(plot.title = element_text(hjust = 0.5, face = 'bold', size = 12)) + 
scale_x_continuous(limits = c(1999, 2016), breaks = c(1999:2016)) + 
scale_y_continuous(limits= c(0, 25), breaks = c(5,10,15,20,25)) 

は折り返されません...私はlabeller = labeller(label_wrap_gen(width = 2を見つけ助け

答えて

0

のため事前にありがとうございます。

facet_grid(STRAT ~ protected_status, 
    labeller = label_wrap_gen(width = 2, multi_line = TRUE)) 
をお試しください
関連する問題