We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05adc9e commit dd0cdf4Copy full SHA for dd0cdf4
+MATLAB/+Graphics/PLine.m
@@ -113,12 +113,18 @@
113
YData=YData(Index);
114
end
115
if isa(ObjectA,'matlab.graphics.chart.primitive.ErrorBar')
116
- if ~isempty(ObjectA.YNegativeDelta)
117
- YPNData(1,:)=-ObjectA.YNegativeDelta(Index);
+
+ %无论有没有空,YPNData必须是(2,2)矩阵,且数据类型未必是数值,所以需要如下精心设计:
118
+ if isempty(ObjectA.YNegativeDelta)
119
+ YPNData(2,:)=ObjectA.YPositiveDelta(Index);
120
+ else
121
+ YPNData(2,:)=-ObjectA.YNegativeDelta(Index);
122
+ YPNData=flipud(YPNData);
123
- if ~isempty(ObjectA.YPositiveDelta)
124
+ if~isempty(ObjectA.YPositiveDelta)
125
YPNData(2,:)=ObjectA.YPositiveDelta(Index);
126
127
128
YData=YData+YPNData([2,4]-(YData<0));
129
130
else
0 commit comments