How to manually change plot x-axis to months
Mostrar comentarios más antiguos
I have been trying to manually change the xtick label to show months instead of the array that i'm plotting, however it only shows a portion of the string and I can't get to show the months from Jan-Dec.
month = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
h(6) = figure;
plot(Day1Sum)
hold on
plot (Day2Sum,'r')
% xlim ([1 hrsyr])
legend ('Load', 'Load with DR')
ylabel ('Load (MWh)')
xticklabels(month)
3 comentarios
KSSV
el 13 de Ag. de 2018
what is size of your Day1Sum ?
hesham fageeh
el 13 de Ag. de 2018
Editada: hesham fageeh
el 13 de Ag. de 2018
Walter Roberson
el 13 de Ag. de 2018
xlim([1 12])
xticks(1:12);
xticklabels(month)
Because you have 12 labels, you need 12 xticks, which probably would not have happened automatically.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Axis Labels en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!