Skip to content

Commit 86fac69

Browse files
committed
3D patch fix
1 parent e3f9777 commit 86fac69

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

plotly/plotlyfig_aux/handlegraphics/updatePatch.m

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,21 @@
169169

170170
%-patch fillcolor-%
171171
fill = extractPatchFace(patch_data);
172-
obj.data{patchIndex}.fillcolor = fill.color;
172+
173+
if strcmp(obj.data{patchIndex}.type,'scatter');
174+
obj.data{patchIndex}.fillcolor = fill.color;
175+
else
176+
obj.data{patchIndex}.surfacecolor = fill.color;
177+
end
178+
179+
%-------------------------------------------------------------------------%
180+
181+
%-surfaceaxis-%
182+
if strcmp(obj.data{patchIndex}.type,'scatter3d');
183+
minstd = min([std(patch_data.XData) std(patch_data.YData) std(patch_data.ZData)]);
184+
ind = find([std(patch_data.XData) std(patch_data.YData) std(patch_data.ZData)] == minstd)-1;
185+
obj.data{patchIndex}.surfaceaxis = ind;
186+
end
173187

174188
%-------------------------------------------------------------------------%
175189

plotly/plotlyfig_aux/helpers/extractPatchFace.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
case 'none'
3737
marker.color = 'rgba(0,0,0,0,)';
3838

39-
case 'flat'
39+
case {'flat','interp'}
4040

4141
switch patch_data.CDataMapping
4242

0 commit comments

Comments
 (0)