Skip to content
Snippets Groups Projects

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

Merged Johannes Pfeifer requested to merge JohannesPfeifer/dseries:hold_on_fix into master
1 file
+ 11
3
Compare changes
  • Side-by-side
  • Inline
+ 11
3
@@ -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)
Loading