Skip to content
Open
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
22 changes: 12 additions & 10 deletions plotly/plotlyfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -499,17 +499,19 @@ 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;
if isfield(ax(i).Children,'Type')
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;
end
end
end
Expand Down
7 changes: 6 additions & 1 deletion plotly/plotlyfig_aux/helpers/extractAxisData.m
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,12 @@
axis.autorange = true;
else
%-axis labels
labels = str2double(axis_data.YTickLabel);
labels = str2double(Tick);
try
dataLim = eval(['axis_data.' axisName 'Lim']);
if isnumeric (dataLim)
axis.range = dataLim;
else
%find numbers in labels
labelnums = find(~isnan(labels));
%-axis type linear-%
Expand All @@ -214,6 +218,7 @@
delta = (labels(labelnums(2)) - labels(labelnums(1)))/(labelnums(2)-labelnums(1));
axis.range = [labels(labelnums(1))-delta*(labelnums(1)-1) labels(labelnums(1)) + (length(labels)-labelnums(1))*delta];
%-axis autotick-%
end
axis.autotick = true;
%-axis numticks-%
axis.nticks = eval(['length(axis_data.' axisName 'Tick) + 1;']);
Expand Down