configuration of subplots - editing titles, fonts and so on

3 vues (au cours des 30 derniers jours)
UgiLishes
UgiLishes le 21 Déc 2019
Commenté : UgiLishes le 21 Déc 2019
Hey everyone,
I currently have to create a lot of subplots, and for each I want to set:
colormap gray; axis image; title('title of spesific subplot','fontname','times','fontsize',16);
Is there any way for me to configure this line only once for all of my subplots instead of adding it for each line I write?
maybe entering the 'title of specific subplot' itself as an array?
thanks,

Réponses (1)

dpb
dpb le 21 Déc 2019
That would be the obvious solution, yes. If the specific title is more or less random text, that's about the only way other than to have saved in an external text file that you read. If it's a generic title that only changes owing to some parameter, then it could be generated programmatically.
From the above limited description, structure the code as a loop over the number of subplots desired something like
nr=3; nc=2; % number rows, columns in subplot figure
nt=nr*nc; % total number subplots
for i=1:nt % for each subplot in order
hAx(i)=subplot(nr,nc,i); % create each subplot; save the axes handles
% do whatever for each subplot here
...
end
  1 commentaire
UgiLishes
UgiLishes le 21 Déc 2019
managed shortning it! thank you very much

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by