Skip to content
Snippets Groups Projects
Verified Commit 1c8cb184 authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Sébastien Villemot
Browse files

plot: do not try to reset xTickLabel based on new dates if hold on was used

(cherry picked from commit 0b93a17e)
parent 45f9364c
Branches
No related tags found
No related merge requests found
Pipeline #7429 passed
......@@ -58,12 +58,20 @@ switch ndseries
id = get(gca,'XTick');
if isequal(id(1),0)
dates = strings([o.dates(1)-1,o.dates(id(2:end))]);
skip_relabeling=0;
else
ID = id(find(isint(id)));
set(gca,'XTick',ID);
dates = strings(o.dates(ID));
if any(ID<o.dates(1).double) || any(ID>o.dates(end).double)
skip_relabeling=1; %hold on was used so that axis tight did not restrict current xlim to dseries used.
else
set(gca,'XTick',ID);
dates = strings(o.dates(ID));
skip_relabeling=0;
end
end
if ~skip_relabeling
set(gca,'XTickLabel',dates);
end
set(gca,'XTickLabel',dates);
case 2
[o0, o1] = align(o, varargin{1});
if isequal(nvariables,1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment