Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d4e3bdc

Browse files
adding spider_plot package funcionality to matlab_plotly
1 parent ac0aaa1 commit d4e3bdc

File tree

3 files changed

+621
-5
lines changed

3 files changed

+621
-5
lines changed

plotly/plotlyfig.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,9 +640,13 @@ function validate(obj)
640640
obj.State.Axis(a).Handle = ax(axrev);
641641

642642
% add title
643-
obj.State.Text(a).Handle = get(ax(axrev),'Title');
644-
obj.State.Text(a).AssociatedAxis = handle(ax(axrev));
645-
obj.State.Text(a).Title = true;
643+
try
644+
obj.State.Text(a).Handle = get(ax(axrev),'Title');
645+
obj.State.Text(a).AssociatedAxis = handle(ax(axrev));
646+
obj.State.Text(a).Title = true;
647+
catch
648+
% TODO
649+
end
646650

647651
% find plots of figure
648652
plots = findobj(ax(axrev),'-not','Type','Text','-not','Type','axes','-depth',1);
@@ -768,6 +772,7 @@ function validate(obj)
768772
% reset dataget(obj.State.Figure.Handle,'Children')
769773
obj.data = {};
770774
obj.PlotOptions.nPlots = obj.State.Figure.NumPlots;
775+
obj.PlotlyDefaults.anIndex = obj.State.Figure.NumTexts + 1;
771776

772777
% reset layout
773778
obj.layout = struct();

plotly/plotlyfig_aux/core/updateData.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,15 @@
4444

4545
switch lower(obj.State.Plot(dataIndex).Class)
4646

47-
%--GEOAXES SPECIAL CASE--%
47+
%--SPIDER PLOT -> SPECIAL CASE--%
48+
case 'spider_plot_class'
49+
updateSpiderPlot(obj, dataIndex);
50+
51+
%--GEOAXES -> SPECIAL CASE--%
4852
case 'geoaxes'
4953
UpdateGeoAxes(obj, dataIndex);
5054

51-
%-EMULATE AXES-%
55+
%-EMULATE AXES -> SPECIAL CASE--%
5256
case 'nothing'
5357
updateOnlyAxes(obj, dataIndex);
5458

0 commit comments

Comments
 (0)