您的位置:首页 > 编程语言 > MATLAB

matlab中绘制带有errorbar误差标的曲线和直方图的方法

2012-11-28 18:52 881 查看
最近写论文绘制实验数据曲线, 需要用到误差范围曲线,如同下图



发现matlab中有errorbar函数可以只用,只要给出low和high 距离即可。

使用方法可以参见matlab help文档:

errorbar(Y,E)
errorbar(X,Y,E)
errorbar(X,Y,L,U)
errorbar(...,LineSpec)
h = errorbar(...)

另外,此处的链接也给出了直方图上增加误差标尺的方法:

原帖请见:http://bio-spring.info/wp/?p=85

效果图如



另外,该blog的作者还给出了如何改变matlab默认直方图颜色的的方法,原帖请见:

http://bio-spring.info/wp/?p=85

另外,直方图横置的方法为,用barh函数:

testData = randn(10000,1); %# test data
[counts,bins] = hist(testData); %# get counts and bin locations
barh(bins,counts)




或者:

h=barh(bins,counts); %# include previous two lines from above
set(get(h,'Parent'),'xdir','r')




原帖请见:http://stackoverflow.com/questions/7774402/how-to-plot-a-horizontal-histogram-in-matlab

另外,这个网页给出了如何在bitmap上写文字或者绘制曲线的方法:

http://www.ilovematlab.cn/thread-27994-1-1.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: