From b563654666c6944d3fc7c10250784f804ae8adb3 Mon Sep 17 00:00:00 2001 From: 3alimoh <87882668+3alimoh@users.noreply.github.com> Date: Tue, 3 Aug 2021 12:24:51 +0200 Subject: [PATCH 1/4] Update updateSurfaceplot.m This will fix the issue #258 --- plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m b/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m index c7fbf3ed..b40bd08e 100644 --- a/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m +++ b/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m @@ -46,6 +46,9 @@ %-surface z-% obj.data{surfaceIndex}.z = image_data.ZData; + %-surface Color-% + obj.data{surfaceIndex}.surfacecolor = image_data.CData; + else %-surface type-% From f9f72a3b90bd35d28ef88d1e51e0fd651839353b Mon Sep 17 00:00:00 2001 From: 3alimoh <87882668+3alimoh@users.noreply.github.com> Date: Wed, 4 Aug 2021 14:52:52 +0200 Subject: [PATCH 2/4] Update updateSurfaceplot.m --- .../handlegraphics/updateSurfaceplot.m | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m b/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m index b40bd08e..85e4876c 100644 --- a/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m +++ b/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m @@ -46,8 +46,6 @@ %-surface z-% obj.data{surfaceIndex}.z = image_data.ZData; - %-surface Color-% - obj.data{surfaceIndex}.surfacecolor = image_data.CData; else @@ -63,6 +61,27 @@ %-------------------------------------------------------------------------% + +%-image colorscale-% + +cmap = figure_data.Colormap; +% or try this one cmap = colormap; + + +for c = 1: length(cmap) + %col = 255*(colormap); + x1=(c-1)/length(cmap); + if x1 > 0.99 + x=round(x1); + else + x=x1; + end + obj.data{surfaceIndex}.colorscale{c} = { x , ['rgb(' num2str(255*cmap(c,1)) ',' num2str(255*cmap(c,2)) ',' num2str(255*cmap(c,3)) ',' ')' ] }; +end + +obj.data{surfaceIndex}.surfacecolor = image_data.CData; +%-------------------------------------------------------------------------% + %-surface name-% obj.data{surfaceIndex}.name = image_data.DisplayName; From 285c427825f4ca77a3b472e0081132a7ee8a3e6e Mon Sep 17 00:00:00 2001 From: 3alimoh <87882668+3alimoh@users.noreply.github.com> Date: Wed, 4 Aug 2021 15:32:07 +0200 Subject: [PATCH 3/4] Update updateSurfaceplot.m --- plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m b/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m index 85e4876c..fb1468d8 100644 --- a/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m +++ b/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m @@ -8,7 +8,7 @@ %-SURFACE DATA STRUCTURE- % image_data = get(obj.State.Plot(surfaceIndex).Handle); - +figure_data = get(obj.State.Figure.Handle); %-AXIS DATA-% eval(['xaxis = obj.layout.xaxis' num2str(xsource) ';']); eval(['yaxis = obj.layout.yaxis' num2str(ysource) ';']); From 2e1f93af62e11fde22258c5d6fe8ee3c1620c6bb Mon Sep 17 00:00:00 2001 From: 3alimoh <87882668+3alimoh@users.noreply.github.com> Date: Thu, 5 Aug 2021 00:44:34 +0200 Subject: [PATCH 4/4] Update updateSurfaceplot.m --- plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m | 3 --- 1 file changed, 3 deletions(-) diff --git a/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m b/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m index fb1468d8..02543c7e 100644 --- a/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m +++ b/plotly/plotlyfig_aux/handlegraphics/updateSurfaceplot.m @@ -65,11 +65,8 @@ %-image colorscale-% cmap = figure_data.Colormap; -% or try this one cmap = colormap; - for c = 1: length(cmap) - %col = 255*(colormap); x1=(c-1)/length(cmap); if x1 > 0.99 x=round(x1);