Skip to content

Fix issues and awesome improve the bar3 functionality #373

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
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
31 changes: 21 additions & 10 deletions plotly/plotlyfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -562,17 +562,21 @@ function validate(obj)
temp_ax = ax; deleted_idx = 0;
for i = 1:length(ax)
for j = i:length(ax)
if ((mean(eq(ax(i).Position, ax(j).Position)) == 1) && (i~=j) && strcmp(ax(i).Children.Type, 'histogram'))
temp_plots = findobj(temp_ax(i),'-not','Type','Text','-not','Type','axes','-depth',1);
if isprop(temp_plots, 'FaceAlpha')
update_opac(i) = true;
else
update_opac(i) = false;
try
if ((mean(eq(ax(i).Position, ax(j).Position)) == 1) && (i~=j) && strcmp(ax(i).Children.Type, 'histogram'))
temp_plots = findobj(temp_ax(i),'-not','Type','Text','-not','Type','axes','-depth',1);
if isprop(temp_plots, 'FaceAlpha')
update_opac(i) = true;
else
update_opac(i) = false;
end
temp_ax(i).YTick = temp_ax(j- deleted_idx).YTick;
temp_ax(i).XTick = temp_ax(j- deleted_idx).XTick;
temp_ax(j - deleted_idx) = [];
deleted_idx = deleted_idx + 1;
end
temp_ax(i).YTick = temp_ax(j- deleted_idx).YTick;
temp_ax(i).XTick = temp_ax(j- deleted_idx).XTick;
temp_ax(j - deleted_idx) = [];
deleted_idx = deleted_idx + 1;
catch
% TODO: error with ax(i).Children.Type. isfield is no enogh
end
end
end
Expand Down Expand Up @@ -625,6 +629,13 @@ function validate(obj)
obj.State.Plot(obj.State.Figure.NumPlots).AssociatedAxis = handle(ax(axrev));
obj.State.Plot(obj.State.Figure.NumPlots).Class = getGraphClass(plots(nprev));
end

% this works for pareto
if length(plots) == 0
if obj.State.Figure.NumPlots ~=0
obj.State.Plot(obj.State.Figure.NumPlots).AssociatedAxis = handle(ax(axrev));
end
end

% find text of figure
texts = findobj(ax(axrev),'Type','text','-depth',1);
Expand Down
4 changes: 3 additions & 1 deletion plotly/plotlyfig_aux/core/updateData.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
elseif strcmpi(obj.PlotOptions.TreatAs, 'polarhistogram')
updateHistogramPolar(obj, dataIndex);
elseif strcmpi(obj.PlotOptions.TreatAs, 'coneplot')
updateConeplot(obj, dataIndex);
updateConeplot(obj, dataIndex);
elseif strcmpi(obj.PlotOptions.TreatAs, 'bar3')
updateBar3(obj, dataIndex);

% this one will be revomed
elseif strcmpi(obj.PlotOptions.TreatAs, 'streamtube')
Expand Down
Loading