フィルターのクリア

how to adjust date limite on the x axis label

1 回表示 (過去 30 日間)
PIA ASSI
PIA ASSI 2021 年 3 月 5 日
回答済み: Nagasai Bharat 2021 年 3 月 8 日
[num, txt,tab] = xlsread('test.xls');
[r,c] = size(num);
DATES= txt(2:r+1,1);
datesnum= datenum(DATES, 'mm/dd/yyyy');
date1= txt(2,1);
date2= txt(end,1);
for x=1:c
asset= txt(1,x+1);
p=plot(datesnum, num(:,x),'Color','k');
%xlim manual
p.LineWidth = 1.5
t1= datesnum(1)
t2= datesnum (30)
%xlim([t1,t2])
datetick ('x','mm/dd/yyyy');
xlabel('Dates','FontSize',14,'FontWeight','bold');
ylabel('Prix','FontSize',14,'FontWeight','bold');
charasset= char(asset);
titletext=['cours de l''action',' ', charasset,' ','entre',' ',char(date1),' ','et',' ', char(date2)];
title(titletext);
savefig(charasset);
print(charasset,'-dpng');
end
  1 件のコメント
PIA ASSI
PIA ASSI 2021 年 3 月 5 日
the data range label is larger than the data itself. how can i adjust it?

サインインしてコメントする。

回答 (1 件)

Nagasai Bharat
Nagasai Bharat 2021 年 3 月 8 日
Hi,
From my understanding you are trying to plot in the range to data the is being plotted rather than the range label you are providing. Use the follwing MATLAB command after the plot command
plot(x,y);
axis tight
The axis should provide you with more detailed information.

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by