Text objects and dot notation

Hi,
What is the fastest way of changing the Position property of multiple text objects?
I've tried the dot notation (as this is said to be the fastest way of manipulating properties of graphical objects), but I can't even access the Position data:
>> hText = handle(text(rand(10,1),rand(10,1),'test'));
>> hText.Position
No appropriate method, property, or field Position for class hg.text.
I would like to do something like this:
hText.Position = [rand(10,1) rand(10,1)];
With line objects, this works perfectly and is faster than using the set-command.
What am I missing here?

Respuestas (1)

Stephen23
Stephen23 el 18 de Sept. de 2015
Editada: Stephen23 el 18 de Sept. de 2015

0 votos

Try removing the handle:
hText = text(rand(10,1),rand(10,1),'test');
The text properties page give this example, which you can adapt for your purpose:
t = text(0.5,0.5,'text here');
s = t.FontSize;
t.FontSize = 12;

Categorías

Más información sobre Graphics Object Properties en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

H
H
el 18 de Sept. de 2015

Editada:

el 18 de Sept. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by