Skip to content

Commit 3337a38

Browse files
Merge pull request #484 from plotly/throw-instead-of-reverting-to-gca
Reverting to gca is a silent bug; throw error instead
2 parents 7196f7f + dbe0162 commit 3337a38

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

plotly/plotlyfig.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,13 +596,17 @@ function validate(obj)
596596
end
597597

598598
% find axes of figure
599-
ax = findobj(obj.State.Figure.Handle,'Type','axes','-and',{'Tag','','-or','Tag','PlotMatrixBigAx','-or','Tag','PlotMatrixScatterAx', '-or','Tag','PlotMatrixHistAx'});
599+
ax = findobj(obj.State.Figure.Handle, ...
600+
{'Type','axes','-or','Type','PolarAxes'}, ...
601+
'-and',{'Tag','','-or','Tag','PlotMatrixBigAx', ...
602+
'-or','Tag','PlotMatrixScatterAx', ...
603+
'-or','Tag','PlotMatrixHistAx'});
600604

601605
if isempty(ax)
602606
try
603607
ax = obj.State.Figure.Handle.Children;
604608
catch
605-
ax = gca;
609+
error("No axes found"); %#ok<CPROP>
606610
end
607611
end
608612

0 commit comments

Comments
 (0)