Azzera filtri
Azzera filtri

how to adjust date limite on the x axis label

1 visualizzazione (ultimi 30 giorni)
PIA ASSI
PIA ASSI il 5 Mar 2021
Risposto: Nagasai Bharat il 8 Mar 2021
[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 Commento
PIA ASSI
PIA ASSI il 5 Mar 2021
the data range label is larger than the data itself. how can i adjust it?

Accedi per commentare.

Risposte (1)

Nagasai Bharat
Nagasai Bharat il 8 Mar 2021
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.

Categorie

Scopri di più su Printing and Saving in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by