R直方图-变量过多 [英] R histogram - too many variables

查看:79
本文介绍了R直方图-变量过多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图说明33种不同变量的直方图.由于变量的数量,我认为在不同的颜色旁边",我需要以清晰的方式标记每个条形,即使可行,即使使用箭头也是如此.

I am trying to illustrate a histogram of 33 different variables. Due to the number of variables I think "beside" different Colors I need to label each bar in a clear way, even using an arrow, if its doable.

我想知道 1)如何在R中定义33种不同的颜色 2)如何标记它们,例如在X轴下方垂直,并且彼此之间保持一定距离,以使我的身材更加清晰.

I was wondering about 1) How can I define 33 distinct color in R 2) How can I label them, say vertical below X axis with a certain distance from each other to make my figure more clear.

我正在使用Plotrix软件包中的多重函数,对于数据,您只能对33个具有不同长度的随机向量成像!

I am using multhist function from Plotrix package, and for data you can image just 33 random vector with different length !

谢谢

推荐答案

您可以通过多种方式在R中定义颜色.尝试?rainbow?greyscale以获得一些建议

You can define colors in R in any number of ways; try ?rainbow or ?greyscale for some suggestions

您还可以在此处查看所有颜色创建您希望在绘图函数中调用的颜色的向量.

You could also look at all the colors here and just create a vector of your desired colors that you call inside your plot function.

但是,您的问题是人眼和印刷过程难以区分和再现许多不同的颜色.有关更多信息(以及有关选择颜色的建议),请参见 colorbrewer 网站上的文档.

Your problem though is that the human eye and the printing process has trouble distinguishing and reproducing that many distinct colors. See the documentation at the colorbrewer site for more information (and advice on picking colors).

不确定我了解您要如何使用标签,但是您可以通过调用axis重新标记一个轴.请参阅?axis中的文档.

Not sure I understand what your trying to do with the labels, but you can re-label an axis with a call to axis. See the documentation in ?axis.

这篇关于R直方图-变量过多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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