Ploting with axes exactly

2 vues (au cours des 30 derniers jours)
Carlos
Carlos le 25 Avr 2014
Modifié(e) : pietro le 25 Avr 2014
Hello, i am making a continuous plot. On X-Axis, every point is a day. On the code i am doing that X value is today, today+1, today+2, etc.
axes(handles.axes4);
tD25(j) = floor(now+j);%quitar el +...
init=length(tD25)-9;
if (init<1)
init=1;
end
set(gcf,'color','white');
drawnow;
plot(tD25(init:end),handles.concentracionPM25diaria(init:end),'-kd','linewidth',1.8)
title('Concentración de PM2,5 diaria');
xlabel('Tiempo (Día/Mes)');
ylabel('Concentración (µg/m3)');
axis manual;
datetick('x','DD mm');%cambiar a DD/mm
grid on;
j=j+1;
The problem is that the plot shows something like that:
And i would like that for every day/month appears on the axe. I mean i would like in axe appears 01/2, 02/2, 03/2, 04/2 ...
If I don't put the month it appear correct:
Any idea? Thank you.

Réponse acceptée

pietro
pietro le 25 Avr 2014
Modifié(e) : pietro le 25 Avr 2014
Hi,
try this:
dailypoints=rand(30*2,1);
figure
plot(dailypoints)
date=datestr(size(dailypoints));
set(gca,'XTickLabels',cellstr(date))

Plus de réponses (1)

Ilham Hardy
Ilham Hardy le 25 Avr 2014
What if your,
datetick('x','DD mm');%cambiar a DD/mm
changed to,
datetick('x',19);%cambiar a DD/mm
Hope it helps,

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by