【发布时间】:2014-11-20 05:23:50
【问题描述】:
我正在尝试bartMachine 包中的investigate_var_importance
investigate_var_importance(bart_machine_cv, num_replicates_for_avg = 20)
原来生成的图这么大,尤其是文字标签和x-axis。默认的[R Graphics: Device 2(Active) 甚至无法容纳整个图片。如何更改此图的字体大小和边距?
【问题讨论】:
-
一种更好的展示这种图表的方式,如果你“转置”图表更容易阅读。 (比例为x轴,类别为y轴)
-
您好 hvollmeier,您能告诉我如何转置图表吗?谢谢!
-
你所要做的就是改变轴。如果您使用 ggplot 创建图形,则使用 diamonds 数据集的一个示例是:原始:
ggplot(diamonds, aes(clarity, fill=cut)) + geom_bar()转置版本:ggplot(diamonds, aes(color, fill=cut)) + geom_bar() + coord_flip()example
标签: r