在 matlab 中使用 shadedErrorBar 时不能使用默认颜色以外的颜色

Cant use colors other than the default ones when using shadedE​rrorBar in matlab

所以我尝试使用 raacampbell/shadedE rrorBar,但无法按照我想要的方式使用漂亮的颜色。 我所能做的就是丑陋的 regular/default 颜色。 它确实让我使用:

ss = shadedErrorBar(x,tav,errbar,'lineProps','r','transparent',true,'patchSaturation',0.08);

但不是

ss = shadedErrorBar(x,tav,errbar,'lineProps','#A62EF4','transparent',true,'patchSaturation',0.08); 

希望有人能提供帮助,我喜欢我的图表:)

MATLAB 颜色被定义为 RGB 的三重值,而不是 #A62EF4 所以你需要将十六进制的A6、2E和F4转换成0.0 ... 1.0之间的值。在十进制中,A6 = 166、2E = 46、F4 = 244,因此将 'r'(红色)替换为 [166 46 244]/255