Helping adding Tittle to Plot (multititle)
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Peter
le 5 Jan 2015
Modifié(e) : UCRMechanicalEngineer
le 29 Juin 2016
Hello,
I have a contour plot and i need a title like that for it:
"my title" variable1 variable2
My title is a character string always the same, but variable1 and variable2 change with every plot.
I have tried this:
title('my title', variable1, variable2);
But it did not work.
Error in ==> title at 55
set(h, 'String', string, pvpairs{:});
I also want to add units to the colourbar and a legend
Thank you very much!
0 commentaires
Réponse acceptée
Star Strider
le 5 Jan 2015
If ‘variable1’ and ‘variable2’ are strings, this works:
variable1 = 'Velocity';
variable2 = 'Position';
figure(1)
scatter(rand(10,1), rand(10,1), 'bp')
title(sprintf('“My Title“ %s %s', variable1, variable2))
10 commentaires
UCRMechanicalEngineer
le 29 Juin 2016
Modifié(e) : UCRMechanicalEngineer
le 29 Juin 2016
Thank you, this helped me.
Plus de réponses (1)
Julian Hapke
le 5 Jan 2015
title(['my title' var1 var2])
depending on the variable type, you may have to convert to string and add separators like whitespace when concatenating.
Voir également
Catégories
En savoir plus sur Title dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!