Skip to content

Commit 3726e60

Browse files
committed
issue_207 fixed
Histogram in the diagonal were not plotting in the original issue. Now they are taken care off. please have a look
1 parent e9abe34 commit 3726e60

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

plotly/plotlyfig.m

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,29 @@ function validate(obj)
480480
obj.State.Figure.NumTexts = 0;
481481

482482
% find axes of figure
483-
ax = findobj(obj.State.Figure.Handle,'Type','axes','-and',{'Tag','','-or','Tag','PlotMatrixBigAx','-or','Tag','PlotMatrixScatterAx'});
483+
ax = findobj(obj.State.Figure.Handle,'Type','axes','-and',{'Tag','','-or','Tag','PlotMatrixBigAx','-or','Tag','PlotMatrixScatterAx', '-or','Tag','PlotMatrixHistAx'});
484+
485+
%---------- checking the overlaping of the graphs ----------%
486+
temp_ax = ax; deleted_idx = 0;
487+
for i = 1:length(ax)
488+
for j = i:length(ax)
489+
if ((mean(eq(ax(i).Position, ax(j).Position)) == 1) && (i~=j))
490+
temp_plots = findobj(temp_ax(i),'-not','Type','Text','-not','Type','axes','-depth',1);
491+
if ~ischar(temp_plots.FaceAlpha)
492+
update_opac(i) = true;
493+
else
494+
update_opac(i) = false;
495+
end
496+
temp_ax(i).YTick = temp_ax(j- deleted_idx).YTick;
497+
temp_ax(i).XTick = temp_ax(j- deleted_idx).XTick;
498+
temp_ax(j - deleted_idx) = [];
499+
deleted_idx = deleted_idx + 1;
500+
end
501+
end
502+
end
503+
ax = temp_ax;
504+
%---------- checking the overlaping of the graphs ----------%
505+
484506
obj.State.Figure.NumAxes = length(ax);
485507

486508
% update number of annotations (one title per axis)
@@ -592,6 +614,12 @@ function validate(obj)
592614
% update plots
593615
for n = 1:obj.State.Figure.NumPlots
594616
updateData(obj,n);
617+
618+
if (strcmp(obj.data{1, n}.type, 'bar') && update_opac(length(ax)-n))
619+
obj.data{1, n}.opacity = 0.9;
620+
obj.data{1, n}.marker.color = 'rgb(0,113.985,188.955)';
621+
end
622+
595623
end
596624

597625
% update annotations

0 commit comments

Comments
 (0)