声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1856|回复: 2

[绘图技巧] [求助]关于hist

[复制链接]
发表于 2006-5-29 17:26 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
先看下列程序
x=binornd(10,0.5,100,1); %生成二项分布随机数
y=binornd(10,0.5,100,1); %同上
z=x*y'; %将x与y向量相乘赋给z
hist(z,50);axis([0,10,0,inf]);
我起先令z=x+y或x-y,画的图都是蓝色条状图(下图后者),而令z=x*y'或x/y,画的图都是各种颜色的(如下图前者)。我知道前两者生成都是向量,后两者生成都是矩阵,但我不知道为什么画出的是彩色图,各自的颜色是什么意思,为什么向量和矩阵的图颜色不一样呢?本人毕业论文就快写完了,可这个问题还没解决,达人帮忙说明下啊,小弟在这里先谢谢了!
1.jpg
2.jpg
回复
分享到:

使用道具 举报

发表于 2006-5-29 20:29 | 显示全部楼层

回复:(sile123)[求助]关于hist

The histogram is created with a patch graphics object. If you want to change the color of the graph, you can set patch properties. See the "Example" section for more information. By default, the graph color is controlled by the current colormap, which maps the bin color to the first color in the colormap.

具体你可以看看colormap的帮助
 楼主| 发表于 2006-5-30 10:55 | 显示全部楼层
谢谢教授,我回去看一下!
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-25 13:17 , Processed in 0.062607 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表