How to customize the subplots?
Afficher commentaires plus anciens
I searched a lot and read the documentation in Matlab, in order to plot 6 plot in one figure. Now it is done but really hard to view:

I want to set 5 years intervals for the x-axis in all plots and small the font size of the x-axis and y-axis in all subplots. Also, I would like to show each subplot with a specific color.
Here is my code:
figure;
subplot(2,3,1);
plot(Date,SI_table.SPI_1month, 'linewidth',1);
xlabel('time step')
ylabel('SPI 1month')
xticks(Date(1:12:end))
ax=gca;
set(ax,'XTickLabelRotation',90)
set(gca,'XTick',(5))
subplot(2,3,2);
plot(Date,SI_table.SPI_3month, 'linewidth',1);
xlabel('time step')
ylabel('SPI 3month')
xticks(Date(1:12:end))
ax=gca;
set(ax,'XTickLabelRotation',90)
subplot(2,3,3);
plot(Date,SI_table.SPI_6month, 'linewidth',1);
xlabel('time step')
ylabel('SPI 6month')
xticks(Date(1:12:end))
ax=gca;
set(ax,'XTickLabelRotation',90)
subplot(2,3,4);
plot(Date,SI_table.SPI_12month, 'linewidth',1);
xlabel('time step')
ylabel('SPI 12month')
xticks(Date(1:12:end))
ax=gca;
set(ax,'XTickLabelRotation',90)
subplot(2,3,5);
plot(Date,SI_table.SPI_24month, 'linewidth',1);
xlabel('time step')
ylabel('SPI 24month')
xticks(Date(1:12:end))
ax=gca;
set(ax,'XTickLabelRotation',90)
subplot(2,3,6);
plot(Date,SI_table.SPI_48month, 'linewidth',1);
xlabel('time step')
ylabel('SPI 48month')
xticks(Date(1:12:end))
ax=gca;
set(ax,'XTickLabelRotation',90)
Thank you so much
Réponse acceptée
Plus de réponses (1)
Alberto Mora
le 5 Fév 2020
0 votes
Have a look to XTrick and XTrickLabel
1 commentaire
BN
le 5 Fév 2020
Catégories
En savoir plus sur Subplots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!