Skip to content

Commit 45dce29

Browse files
authored
Merge pull request #228 from plotly/issue225
fix issue #225
2 parents 97f9eb0 + c977e7d commit 45dce29

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
dev/
2-
*.asv
2+
*.asv
3+
untitled.html

plotly/plotlyfig_aux/handlegraphics/updateArea.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,16 @@ function updateArea(obj,areaIndex)
9999
%-------------------------------------------------------------------------%
100100

101101
%-area x-%
102-
xdata = area_child.VertexData(1,:);
103-
obj.data{areaIndex}.x = [xdata xdata(1)];
102+
obj.data{areaIndex}.x = area_data.XData;
104103

105104
%-------------------------------------------------------------------------%
106105

107106
%-area y-%
108-
ydata = area_child.VertexData(2,:);
109-
obj.data{areaIndex}.y = [ydata ydata(1)];
107+
if areaIndex>1
108+
obj.data{areaIndex}.y = obj.data{areaIndex-1}.y + area_data.YData;
109+
else
110+
obj.data{areaIndex}.y = area_data.YData;
111+
end
110112

111113
%-------------------------------------------------------------------------%
112114

@@ -125,7 +127,7 @@ function updateArea(obj,areaIndex)
125127
%-------------------------------------------------------------------------%
126128

127129
%-area fill-%
128-
obj.data{areaIndex}.fill = 'tozeroy';
130+
obj.data{areaIndex}.fill = 'tonexty';
129131

130132
%-------------------------------------------------------------------------%
131133

0 commit comments

Comments
 (0)