Skip to content

Commit 5c5c3c6

Browse files
Merge pull request #406 from plotly/fixing_issues_387_389_and_other_ones
fixing issues #387, #389 and other ones
2 parents ebd87b7 + 114ce4b commit 5c5c3c6

File tree

8 files changed

+689
-442
lines changed

8 files changed

+689
-442
lines changed

plotly/plotlyfig.m

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,11 @@ function validate(obj)
584584
ax = findobj(obj.State.Figure.Handle,'Type','axes','-and',{'Tag','','-or','Tag','PlotMatrixBigAx','-or','Tag','PlotMatrixScatterAx', '-or','Tag','PlotMatrixHistAx'});
585585

586586
if isempty(ax)
587-
ax = gca;
587+
try
588+
ax = get(obj.State.Figure.Handle,'Children');
589+
catch
590+
ax = gca;
591+
end
588592
end
589593

590594
%---------- checking the overlaping of the graphs ----------%
@@ -661,7 +665,9 @@ function validate(obj)
661665
nprev = length(plots) - np + 1;
662666

663667
% update the plot fields
664-
if ~strcmpi(getGraphClass(plots(nprev)), 'light')
668+
plotClass = lower(getGraphClass(plots(nprev)));
669+
670+
if ~ismember(plotClass, {'light', 'polaraxes'})
665671
obj.State.Figure.NumPlots = obj.State.Figure.NumPlots + 1;
666672
obj.State.Plot(obj.State.Figure.NumPlots).Handle = handle(plots(nprev));
667673
obj.State.Plot(obj.State.Figure.NumPlots).AssociatedAxis = handle(ax(axrev));
@@ -672,11 +678,16 @@ function validate(obj)
672678
end
673679

674680
% this works for pareto
675-
if length(plots) == 0 & obj.State.Figure.NumPlots ~= 0
676-
isPareto = length(ax) >= 2 & obj.State.Figure.NumPlots >= 2;
677-
isBar = strcmpi(lower(obj.State.Plot(obj.State.Figure.NumPlots).Class), 'line');
678-
isLine = strcmpi(lower(obj.State.Plot(obj.State.Figure.NumPlots-1).Class), 'bar');
679-
isPareto = isPareto & isBar & isLine;
681+
if length(plots) == 0
682+
683+
try
684+
isPareto = length(ax) >= 2 & obj.State.Figure.NumPlots >= 2;
685+
isBar = strcmpi(lower(obj.State.Plot(obj.State.Figure.NumPlots).Class), 'line');
686+
isLine = strcmpi(lower(obj.State.Plot(obj.State.Figure.NumPlots-1).Class), 'bar');
687+
isPareto = isPareto & isBar & isLine;
688+
catch
689+
isPareto = false;
690+
end
680691

681692
if isPareto
682693
obj.State.Plot(obj.State.Figure.NumPlots).AssociatedAxis = handle(ax(axrev));
@@ -798,6 +809,9 @@ function validate(obj)
798809
else
799810
if ~obj.PlotlyDefaults.isTernary
800811
updateAnnotation(obj,n);
812+
if obj.State.Figure.NumAxes == 1
813+
obj.PlotOptions.CleanFeedTitle = false;
814+
end
801815
end
802816
end
803817
catch

plotly/plotlyfig_aux/core/updateData.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
updatePie3(obj, dataIndex);
1111
elseif ismember('pcolor', lower(obj.PlotOptions.TreatAs))
1212
updatePColor(obj, dataIndex);
13-
elseif ismember('polarplot', lower(obj.PlotOptions.TreatAs))
14-
updatePolarplot(obj, dataIndex);
1513
elseif ismember('contour3', lower(obj.PlotOptions.TreatAs))
1614
updateContour3(obj, dataIndex);
1715
elseif ismember('compass', lower(obj.PlotOptions.TreatAs))
@@ -50,6 +48,10 @@
5048
case 'geoaxes'
5149
UpdateGeoAxes(obj, dataIndex);
5250

51+
%-EMULATE AXES-%
52+
case 'nothing'
53+
updateOnlyAxes(obj, dataIndex);
54+
5355
%--CORE PLOT OBJECTS--%
5456
case 'geobubble'
5557
updateGeobubble(obj, dataIndex);
@@ -68,6 +70,8 @@
6870
case 'line'
6971
if obj.PlotlyDefaults.isGeoaxis
7072
updateGeoPlot(obj, dataIndex);
73+
elseif ismember('polarplot', lower(obj.PlotOptions.TreatAs))
74+
updatePolarplot(obj, dataIndex);
7175
elseif ismember('ternplot', lower(obj.PlotOptions.TreatAs))
7276
updateTernaryPlot(obj, dataIndex);
7377
else
@@ -139,7 +143,7 @@
139143
case 'quivergroup'
140144
updateQuivergroup(obj, dataIndex);
141145
case 'scatter'
142-
if ismember('polaraxes', lower(obj.PlotOptions.TreatAs))
146+
if ismember('scatterpolar', lower(obj.PlotOptions.TreatAs))
143147
updateScatterPolar(obj, dataIndex);
144148
elseif obj.PlotlyDefaults.isGeoaxis
145149
updateGeoScatter(obj, dataIndex);

0 commit comments

Comments
 (0)