[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Text extent property
From: |
Søren Hauberg |
Subject: |
Re: Text extent property |
Date: |
Sat, 06 Mar 2010 11:17:45 -0800 |
lor, 06 03 2010 kl. 18:41 +0000, skrev Michael Goffioul:
> BTW, could anybody check a few things for me on Matlab?
> - does "extent" property takes text rotation into account
>> th = text (1, 1, 'Why am I using Matlab, when I could be using
Octave?');
>> get (th, 'extent')
ans =
0.9954 0.9708 0.7218 0.0496
>> set (th, 'Rotation', 45)
>> get (th, 'extent')
ans =
0.7816 0.9329 5.5172 1.4052
So, it looks like rotation is taken into account.
> - what's the width and height values of "extent" for text using
> "data" units and the axes is in 3D view?
>> plot3 ([1, 100], [1, 100], [1, 100])
>> th = text (1, 1, 1, 'Why am I using Matlab, when I could be using
Octave?')
>> get (th, 'extent')
ans =
0 0 0 0
>> get (th, 'Units')
ans =
data
> - when "units" is set to something different than "data",
>> set (th, 'Units', 'Pixels')
>> get (th, 'extent')
ans =
190 -5 314 17
>> set (th, 'Units', 'Normalized')
>> get (th, 'extent')
ans =
0.4345 -0.0175 0.7218 0.0496
>> set (th, 'Units', 'Inches')
>> get (th, 'extent')
ans =
2.1000 -0.0667 3.4889 0.1889
>> set (th, 'Units', 'Centimeters')
>> get (th, 'extent')
ans =
5.3299 -0.1692 8.8550 0.4794
>> set (th, 'Units', 'Points')
>> get (th, 'extent')
ans =
151.2000 -4.8000 251.2000 13.6000
>> set (th, 'Units', 'Characters')
>> get (th, 'extent')
ans =
31.5000 -0.4286 52.3333 1.2143
>> set (th, 'Units', 'Data')
>> get (th, 'extent')
ans =
31.5000 -0.4286 52.3333 1.2143
So, it seems that 'extent' doesn't change when you set the units to
'Data'.
> what's the "z" value of "position"?
>> plot3 ([1, 100], [1, 100], [1, 100])
>> th = text (1, 1, 1, 'Why am I using Matlab, when I could be using
Octave?');
>> get (th, 'Position')
ans =
1 1 1
>> get (th, 'Units')
ans =
data
>> set (th, 'Units', 'Pixels')
>> get (th, 'Position')
ans =
190 4 0
>> set (th, 'Units', 'Normalized')
>> get (th, 'Position')
ans =
0.4345 0.0087 0
>> set (th, 'Units', 'Inches')
>> get (th, 'Position')
ans =
2.1000 0.0333 0
>> set (th, 'Units', 'Centimeters')
>> get (th, 'Position')
ans =
5.3299 0.0846 0
>> set (th, 'Units', 'Points')
>> get (th, 'Position')
ans =
151.2000 2.4000 0
>> set (th, 'Units', 'Characters')
>> get (th, 'Position')
ans =
31.5000 0.2143 0
>> set (th, 'Units', 'Data')
>> get (th, 'Position')
ans =
0.7428 0.9317 0.6349
Hope that helps
Soren