Skip to content
Snippets Groups Projects
Commit 5f79cf02 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Merge branch 'hold_on_fix' into 'master'

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

See merge request Dynare/dseries!43
parents 374c6e5b 0b93a17e
No related branches found
No related tags found
No related merge requests found
......@@ -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.
Finish editing this message first!
Please register or to comment