From 4f9905ddea37b1e2fa95ba8a6da62e06d2bfba67 Mon Sep 17 00:00:00 2001 From: Gilberto Galvis Date: Fri, 30 Jul 2021 12:55:50 -0400 Subject: [PATCH 1/3] fix issue #225 --- plotly/plotlyfig_aux/handlegraphics/updateArea.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plotly/plotlyfig_aux/handlegraphics/updateArea.m b/plotly/plotlyfig_aux/handlegraphics/updateArea.m index e091e3f9..0442099a 100644 --- a/plotly/plotlyfig_aux/handlegraphics/updateArea.m +++ b/plotly/plotlyfig_aux/handlegraphics/updateArea.m @@ -99,14 +99,16 @@ function updateArea(obj,areaIndex) %-------------------------------------------------------------------------% %-area x-% -xdata = area_child.VertexData(1,:); -obj.data{areaIndex}.x = [xdata xdata(1)]; +% xdata = area_child.VertexData(1,:); % left commented it to futures problems +% obj.data{areaIndex}.x = [xdata xdata(1)]; +obj.data{areaIndex}.x = area_data.XData; %-------------------------------------------------------------------------% %-area y-% -ydata = area_child.VertexData(2,:); -obj.data{areaIndex}.y = [ydata ydata(1)]; +% ydata = area_child.VertexData(2,:); % left commented it to futures problems +% obj.data{areaIndex}.y = [ydata ydata(1)]; +obj.data{areaIndex}.y = area_data.YData; %-------------------------------------------------------------------------% From fcb3c6655066bbcb3e32a4679c57add0d4853471 Mon Sep 17 00:00:00 2001 From: Harsh Purwar Date: Thu, 5 Aug 2021 11:52:42 +0900 Subject: [PATCH 2/3] cumsum in area plots --- .gitignore | 3 ++- plotly/plotlyfig_aux/handlegraphics/updateArea.m | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index caf01ec9..d2116591 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -dev/ \ No newline at end of file +dev/ +untitled.html \ No newline at end of file diff --git a/plotly/plotlyfig_aux/handlegraphics/updateArea.m b/plotly/plotlyfig_aux/handlegraphics/updateArea.m index 0442099a..c180a0ec 100644 --- a/plotly/plotlyfig_aux/handlegraphics/updateArea.m +++ b/plotly/plotlyfig_aux/handlegraphics/updateArea.m @@ -99,24 +99,24 @@ function updateArea(obj,areaIndex) %-------------------------------------------------------------------------% %-area x-% -% xdata = area_child.VertexData(1,:); % left commented it to futures problems -% obj.data{areaIndex}.x = [xdata xdata(1)]; obj.data{areaIndex}.x = area_data.XData; %-------------------------------------------------------------------------% %-area y-% -% ydata = area_child.VertexData(2,:); % left commented it to futures problems -% obj.data{areaIndex}.y = [ydata ydata(1)]; -obj.data{areaIndex}.y = area_data.YData; +if areaIndex>1 + obj.data{areaIndex}.y = obj.data{areaIndex-1}.y + area_data.YData; +else + obj.data{areaIndex}.y = area_data.YData; +end %-------------------------------------------------------------------------% %-area name-% -if ~isempty(area_data.DisplayName); +if isfield(area_data,'DisplayName') obj.data{areaIndex}.name = area_data.DisplayName; else - obj.data{areaIndex}.name = area_data.DisplayName; + obj.data{areaIndex}.name = ''; end %-------------------------------------------------------------------------% @@ -127,7 +127,7 @@ function updateArea(obj,areaIndex) %-------------------------------------------------------------------------% %-area fill-% -obj.data{areaIndex}.fill = 'tozeroy'; +obj.data{areaIndex}.fill = 'tonexty'; %-------------------------------------------------------------------------% From cca6c0163bb5c0dcd0e946966f02e5177142e3b5 Mon Sep 17 00:00:00 2001 From: Harsh Purwar Date: Thu, 5 Aug 2021 12:11:16 +0900 Subject: [PATCH 3/3] Revert unintentional changes --- plotly/plotlyfig_aux/handlegraphics/updateArea.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plotly/plotlyfig_aux/handlegraphics/updateArea.m b/plotly/plotlyfig_aux/handlegraphics/updateArea.m index c180a0ec..b3e019ad 100644 --- a/plotly/plotlyfig_aux/handlegraphics/updateArea.m +++ b/plotly/plotlyfig_aux/handlegraphics/updateArea.m @@ -113,10 +113,10 @@ function updateArea(obj,areaIndex) %-------------------------------------------------------------------------% %-area name-% -if isfield(area_data,'DisplayName') +if ~isempty(area_data.DisplayName); obj.data{areaIndex}.name = area_data.DisplayName; else - obj.data{areaIndex}.name = ''; + obj.data{areaIndex}.name = area_data.DisplayName; end %-------------------------------------------------------------------------%