matlab - 错误栏的不同颜色 Matlab 2014b

标签 matlab colors

我正在绘制误差线,并想用不同的颜色为每个误差线着色,以使绘图更容易理解。但是,由于我使用的是 matlab2014b,因此在线的所有内容都已过时,因为错误栏系列不再有子项。这是我正在使用的代码:

x=[1 2 3 4]
y=[0.5 0.3 0.45 0.36]
upperbound=y.*0.25
lowerbound=y.*0.15

fig1=figure  
e1=errorbar(x,y,lowerbound,upperbound,'x')

如果可能的话,我也想给中心点上色,在此先感谢。

最佳答案

也许您可以单独绘制每个误差条,例如:

hold on
for k = 1:length(x)
    e1 = errorbar(x(k),y(k),lowerbound(k),upperbound(k),'x');
    set(e1,'Color',rand(1,3))
    set(e1,'MarkerEdgeColor',rand(1,3))
end

参见 Errorbar Series Properties有关如何更改线条样式、颜色等的更多信息。

关于matlab - 错误栏的不同颜色 Matlab 2014b,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31214955/

相关文章:

optimization - 什么时候不对 matlab 进行矢量化?

css - fullCalendar - 更改一段时间的单元格颜色

algorithm - 给灰度位图上色的词是什么

matlab - 对 Simulink 模型进行集成测试

matlab - 如何在 MATLAB 中正确执行此 if 语句

image - 在 MATLAB 中绘制两个图像之间的匹配点

c - 褪色功能错误

colors - 如何在 Dreamweaver CS5 (Windows) 中将代码配色方案重置为默认值?

c# - 如何使用 DataBinder 更改行中文本的颜色

python - Matlab代码到Python代码的转换(使用数据帧)