Skip to content

fixing issues #387, #389 and other ones #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions plotly/plotlyfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,11 @@ function validate(obj)
ax = findobj(obj.State.Figure.Handle,'Type','axes','-and',{'Tag','','-or','Tag','PlotMatrixBigAx','-or','Tag','PlotMatrixScatterAx', '-or','Tag','PlotMatrixHistAx'});

if isempty(ax)
ax = gca;
try
ax = get(obj.State.Figure.Handle,'Children');
catch
ax = gca;
end
end

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

% update the plot fields
if ~strcmpi(getGraphClass(plots(nprev)), 'light')
plotClass = lower(getGraphClass(plots(nprev)));

if ~ismember(plotClass, {'light', 'polaraxes'})
obj.State.Figure.NumPlots = obj.State.Figure.NumPlots + 1;
obj.State.Plot(obj.State.Figure.NumPlots).Handle = handle(plots(nprev));
obj.State.Plot(obj.State.Figure.NumPlots).AssociatedAxis = handle(ax(axrev));
Expand All @@ -658,11 +664,16 @@ function validate(obj)
end

% this works for pareto
if length(plots) == 0 & obj.State.Figure.NumPlots ~= 0
isPareto = length(ax) >= 2 & obj.State.Figure.NumPlots >= 2;
isBar = strcmpi(lower(obj.State.Plot(obj.State.Figure.NumPlots).Class), 'line');
isLine = strcmpi(lower(obj.State.Plot(obj.State.Figure.NumPlots-1).Class), 'bar');
isPareto = isPareto & isBar & isLine;
if length(plots) == 0

try
isPareto = length(ax) >= 2 & obj.State.Figure.NumPlots >= 2;
isBar = strcmpi(lower(obj.State.Plot(obj.State.Figure.NumPlots).Class), 'line');
isLine = strcmpi(lower(obj.State.Plot(obj.State.Figure.NumPlots-1).Class), 'bar');
isPareto = isPareto & isBar & isLine;
catch
isPareto = false;
end

if isPareto
obj.State.Plot(obj.State.Figure.NumPlots).AssociatedAxis = handle(ax(axrev));
Expand Down Expand Up @@ -784,6 +795,9 @@ function validate(obj)
else
if ~obj.PlotlyDefaults.isTernary
updateAnnotation(obj,n);
if obj.State.Figure.NumAxes == 1
obj.PlotOptions.CleanFeedTitle = false;
end
end
end
catch
Expand Down
10 changes: 7 additions & 3 deletions plotly/plotlyfig_aux/core/updateData.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
updatePie3(obj, dataIndex);
elseif ismember('pcolor', lower(obj.PlotOptions.TreatAs))
updatePColor(obj, dataIndex);
elseif ismember('polarplot', lower(obj.PlotOptions.TreatAs))
updatePolarplot(obj, dataIndex);
elseif ismember('contour3', lower(obj.PlotOptions.TreatAs))
updateContour3(obj, dataIndex);
elseif ismember('compass', lower(obj.PlotOptions.TreatAs))
Expand Down Expand Up @@ -50,6 +48,10 @@
case 'geoaxes'
UpdateGeoAxes(obj, dataIndex);

%-EMULATE AXES-%
case 'nothing'
updateOnlyAxes(obj, dataIndex);

%--CORE PLOT OBJECTS--%
case 'geobubble'
updateGeobubble(obj, dataIndex);
Expand All @@ -68,6 +70,8 @@
case 'line'
if obj.PlotlyDefaults.isGeoaxis
updateGeoPlot(obj, dataIndex);
elseif ismember('polarplot', lower(obj.PlotOptions.TreatAs))
updatePolarplot(obj, dataIndex);
elseif ismember('ternplot', lower(obj.PlotOptions.TreatAs))
updateTernaryPlot(obj, dataIndex);
else
Expand Down Expand Up @@ -137,7 +141,7 @@
case 'quivergroup'
updateQuivergroup(obj, dataIndex);
case 'scatter'
if ismember('polaraxes', lower(obj.PlotOptions.TreatAs))
if ismember('scatterpolar', lower(obj.PlotOptions.TreatAs))
updateScatterPolar(obj, dataIndex);
elseif obj.PlotlyDefaults.isGeoaxis
updateGeoScatter(obj, dataIndex);
Expand Down
Loading