如何在R中绘制堆积柱形图? [英] How to plot a stacked column graph in R?

查看:101
本文介绍了如何在R中绘制堆积柱形图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何使用R绘制直方图,其中的列由1个以上的变量堆叠?就像excel中的堆积列"图一样.

does anyone know how to use R to plot a histogram with the columns stacked up by more than 1 variables? Like the "stacked column" graph in excel.

谢谢!

推荐答案

我假设您真的想要条形图而不是直方图.在那种情况下,来自标准图形的 barplot 或来自点阵软件包的 barchart 都可以做到.或使用ggplot,如此示例

I'm assuming you really want a bar chart rather than a histogram. In that case, barplot from standard graphics or barchart from the lattice package will both do it. Or use ggplot as shown in this example or here

这篇关于如何在R中绘制堆积柱形图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆