Skip to content

Commit 114ce4b

Browse files
fixing issues #387, #389 and other ones
1 parent ef95b87 commit 114ce4b

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
@@ -570,7 +570,11 @@ function validate(obj)
570570
ax = findobj(obj.State.Figure.Handle,'Type','axes','-and',{'Tag','','-or','Tag','PlotMatrixBigAx','-or','Tag','PlotMatrixScatterAx', '-or','Tag','PlotMatrixHistAx'});
571571

572572
if isempty(ax)
573-
ax = gca;
573+
try
574+
ax = get(obj.State.Figure.Handle,'Children');
575+
catch
576+
ax = gca;
577+
end
574578
end
575579

576580
%---------- checking the overlaping of the graphs ----------%
@@ -647,7 +651,9 @@ function validate(obj)
647651
nprev = length(plots) - np + 1;
648652

649653
% update the plot fields
650-
if ~strcmpi(getGraphClass(plots(nprev)), 'light')
654+
plotClass = lower(getGraphClass(plots(nprev)));
655+
656+
if ~ismember(plotClass, {'light', 'polaraxes'})
651657
obj.State.Figure.NumPlots = obj.State.Figure.NumPlots + 1;
652658
obj.State.Plot(obj.State.Figure.NumPlots).Handle = handle(plots(nprev));
653659
obj.State.Plot(obj.State.Figure.NumPlots).AssociatedAxis = handle(ax(axrev));
@@ -658,11 +664,16 @@ function validate(obj)
658664
end
659665

660666
% this works for pareto
661-
if length(plots) == 0 & obj.State.Figure.NumPlots ~= 0
662-
isPareto = length(ax) >= 2 & obj.State.Figure.NumPlots >= 2;
663-
isBar = strcmpi(lower(obj.State.Plot(obj.State.Figure.NumPlots).Class), 'line');
664-
isLine = strcmpi(lower(obj.State.Plot(obj.State.Figure.NumPlots-1).Class), 'bar');
665-
isPareto = isPareto & isBar & isLine;
667+
if length(plots) == 0
668+
669+
try
670+
isPareto = length(ax) >= 2 & obj.State.Figure.NumPlots >= 2;
671+
isBar = strcmpi(lower(obj.State.Plot(obj.State.Figure.NumPlots).Class), 'line');
672+
isLine = strcmpi(lower(obj.State.Plot(obj.State.Figure.NumPlots-1).Class), 'bar');
673+
isPareto = isPareto & isBar & isLine;
674+
catch
675+
isPareto = false;
676+
end
666677

667678
if isPareto
668679
obj.State.Plot(obj.State.Figure.NumPlots).AssociatedAxis = handle(ax(axrev));
@@ -784,6 +795,9 @@ function validate(obj)
784795
else
785796
if ~obj.PlotlyDefaults.isTernary
786797
updateAnnotation(obj,n);
798+
if obj.State.Figure.NumAxes == 1
799+
obj.PlotOptions.CleanFeedTitle = false;
800+
end
787801
end
788802
end
789803
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
@@ -137,7 +141,7 @@
137141
case 'quivergroup'
138142
updateQuivergroup(obj, dataIndex);
139143
case 'scatter'
140-
if ismember('polaraxes', lower(obj.PlotOptions.TreatAs))
144+
if ismember('scatterpolar', lower(obj.PlotOptions.TreatAs))
141145
updateScatterPolar(obj, dataIndex);
142146
elseif obj.PlotlyDefaults.isGeoaxis
143147
updateGeoScatter(obj, dataIndex);

0 commit comments

Comments
 (0)