Skip to content

Commit 81c0f7f

Browse files
fix almost all issues working with pie3 code-examples in ssim_baselines/matlab/code-examples/data-distribution-plots/pie3/
1 parent 045f0d1 commit 81c0f7f

File tree

4 files changed

+340
-288
lines changed

4 files changed

+340
-288
lines changed

plotly/plotlyfig.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,10 @@ function validate(obj)
573573

574574
% get number of nbars for pie3
575575
if strcmpi(obj.PlotOptions.TreatAs, 'pie3')
576-
obj.PlotOptions.nbars = 0;
576+
obj.PlotOptions.nbars{a} = 0;
577577
for i = 1:length(plots)
578578
if strcmpi(getGraphClass(plots(i)), 'surface')
579-
obj.PlotOptions.nbars = obj.PlotOptions.nbars + 1;
579+
obj.PlotOptions.nbars{a} = obj.PlotOptions.nbars{a} + 1;
580580
end
581581
end
582582
end

plotly/plotlyfig_aux/core/updateAnnotation.m

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,29 @@
9191
%-------------------------------------------------------------------------%
9292

9393
%-text-%
94-
if ~strcmpi(obj.PlotOptions.TreatAs, 'pie3')
94+
if obj.State.Text(anIndex).Title
9595
obj.layout.annotations{anIndex}.text = parseString(text_data.String,text_data.Interpreter);
96-
if obj.State.Text(anIndex).Title && isempty(text_data.String)
96+
if isempty(text_data.String)
9797
obj.layout.annotations{anIndex}.text = '<b></b>'; %empty string annotation
9898
end
9999
else
100-
obj.layout.annotations{anIndex}.text = '<b></b>';
100+
if ~strcmpi(obj.PlotOptions.TreatAs, 'pie3')
101+
obj.layout.annotations{anIndex}.text = parseString(text_data.String,text_data.Interpreter);
102+
else
103+
obj.layout.annotations{anIndex}.text = '<b></b>';
104+
end
101105
end
102106

107+
%-optional code flow-%
108+
% if ~strcmpi(obj.PlotOptions.TreatAs, 'pie3')
109+
% obj.layout.annotations{anIndex}.text = parseString(text_data.String,text_data.Interpreter);
110+
% if obj.State.Text(anIndex).Title && isempty(text_data.String)
111+
% obj.layout.annotations{anIndex}.text = '<b></b>'; %empty string annotation
112+
% end
113+
% else
114+
% obj.layout.annotations{anIndex}.text = '<b></b>';
115+
% end
116+
103117
%-------------------------------------------------------------------------%
104118

105119
if obj.State.Text(anIndex).Title

plotly/plotlyfig_aux/core/updateAxis.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@
9696

9797
%-xaxis domain-%
9898
xaxis.domain = min([xo xo + w],1);
99+
scene.domain.x = min([xo xo + w],1);
99100

100101
%-------------------------------------------------------------------------%
101102

102103
%-yaxis domain-%
103104
yaxis.domain = min([yo yo + h],1);
105+
scene.domain.y = min([yo yo + h],1);
104106

105107
%-------------------------------------------------------------------------%
106108

@@ -135,6 +137,7 @@
135137
% update the layout field (do not overwrite source)
136138
if xsource == axIndex
137139
obj.layout = setfield(obj.layout,['xaxis' num2str(xsource)],xaxis);
140+
obj.layout = setfield(obj.layout,['scene' num2str(xsource)],scene);
138141
else
139142

140143
end

0 commit comments

Comments
 (0)