Skip to content
Snippets Groups Projects
Verified Commit c7fb0bd5 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Fix issue #59.

Dates were only shown on the x-axis for yearly data.

(cherry picked from commit e2d2f85e)
parent c9db0144
No related branches found
No related tags found
No related merge requests found
Pipeline #11340 passed
...@@ -55,23 +55,9 @@ switch ndseries ...@@ -55,23 +55,9 @@ switch ndseries
hh = plot(o.data); hh = plot(o.data);
end end
axis tight; axis tight;
id = get(gca,'XTick'); id = get(gca, 'XTick');
if isequal(id(1),0) Dates = strings(o.dates(id));
dates = strings([o.dates(1)-1,o.dates(id(2:end))]); set(gca,'XTickLabel', Dates);
skip_relabeling=0;
else
ID = id(find(isint(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
case 2 case 2
[o0, o1] = align(o, varargin{1}); [o0, o1] = align(o, varargin{1});
if isequal(nvariables,1) if isequal(nvariables,1)
...@@ -89,4 +75,4 @@ end ...@@ -89,4 +75,4 @@ end
if nargout if nargout
h = hh; h = hh;
end end
\ No newline at end of file
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