x-axis on plot has cushion to left and right (i.e. plot doesn't start at beginning, and ends early with remaining space in the chart
Show older comments
Here is my code:
startDate=datenum(num2str(tday(1)),'yyyymmdd');
endDate=datenum(num2str(tday(end)),'yyyymmdd');
cumret=cumprod(1+combinedRet)-1;
x=linspace(startDate,endDate,length(cumret));
plot(x,cumret);
ax=gca;
datetick('x',2,'keepticks');
ax.XTickLabelRotation=45;
My start date and end date are 8/24/12 - 5/29/15. So why does the x-axis start at 5/11/12 and end at 8/24/15?
Also, how can I increase the number of dates shown on the x-axis?
Many thanks, I am very grateful.
Accepted Answer
More Answers (0)
Categories
Find more on Language Fundamentals in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!