From a46d7566becff8d19f691791ef870dddbca056e8 Mon Sep 17 00:00:00 2001 From: Harsh Purwar Date: Fri, 30 Jul 2021 13:04:04 +0900 Subject: [PATCH] Modification for area plots --- plotly/plotlyfig.m | 2 +- plotly/plotlyfig_aux/handlegraphics/updateArea.m | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/plotly/plotlyfig.m b/plotly/plotlyfig.m index 30b43a45..81236767 100644 --- a/plotly/plotlyfig.m +++ b/plotly/plotlyfig.m @@ -56,7 +56,7 @@ obj.PlotOptions.WorldReadable = true; obj.PlotOptions.ShowURL = true; obj.PlotOptions.OpenURL = true; - obj.PlotOptions.Strip = true; + obj.PlotOptions.Strip = false; obj.PlotOptions.Visible = 'on'; obj.PlotOptions.TriangulatePatch = false; diff --git a/plotly/plotlyfig_aux/handlegraphics/updateArea.m b/plotly/plotlyfig_aux/handlegraphics/updateArea.m index e091e3f9..ffb46d93 100644 --- a/plotly/plotlyfig_aux/handlegraphics/updateArea.m +++ b/plotly/plotlyfig_aux/handlegraphics/updateArea.m @@ -100,18 +100,18 @@ function updateArea(obj,areaIndex) %-area x-% xdata = area_child.VertexData(1,:); -obj.data{areaIndex}.x = [xdata xdata(1)]; +obj.data{areaIndex}.x = xdata; %-------------------------------------------------------------------------% %-area y-% ydata = area_child.VertexData(2,:); -obj.data{areaIndex}.y = [ydata ydata(1)]; +obj.data{areaIndex}.y = ydata; %-------------------------------------------------------------------------% %-area name-% -if ~isempty(area_data.DisplayName); +if ~isempty(area_data.DisplayName) obj.data{areaIndex}.name = area_data.DisplayName; else obj.data{areaIndex}.name = area_data.DisplayName; @@ -127,6 +127,14 @@ function updateArea(obj,areaIndex) %-area fill-% obj.data{areaIndex}.fill = 'tozeroy'; +%-overwrite for stacked-% +if areaIndex==2 + obj.data{areaIndex-1}.fill = 'tonexty'; + obj.data{areaIndex}.fill = 'tonexty'; +elseif areaIndex>2 + obj.data{areaIndex}.fill = 'tonexty'; +end + %-------------------------------------------------------------------------% %-AREA MODE-%