normal, relative and ellipse [message #90321] |
Thu, 19 February 2015 15:39  |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
Hi,
I just thought that I found a bug, but then I though about it again and well... I stopped after a while.
Can anybody explain me this:
i = image(/test, image_dimensions=[500,500], dimensions=[500,500])
e1 = ellipse(0.5,0.5,major=0.5,minor=0.5, fill_transparency=50,fill_color='red',/norm,target=i, /relative)
e2 = ellipse(0.5,0.5,major=0.5,minor=0.5, fill_transparency=50,fill_color='yellow',/norm,target=i, /relative)
now rescale the window and change the window aspect ratio (make it for example larger).
e2 = ellipse(0.5,0.5,major=0.5,minor=0.5, fill_transparency=50,fill_color='yellow',/norm,target=i, /relative)
I would have expected e1 and e2 to be the same. According to the documentation for target:
"Set this keyword to indicate that the input arguments are specified in normalized [0,1] coordinates, relative to the axis range of the TARGET's dataspace."
What is the reason for this behavior? Bug or feature?
Thanks,
Helder
|
|
|
Re: normal, relative and ellipse [message #90324 is a reply to message #90321] |
Fri, 20 February 2015 07:27   |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
On Thursday, February 19, 2015 at 4:39:23 PM UTC-7, Helder wrote:
> Hi,
> I just thought that I found a bug, but then I though about it again and well... I stopped after a while.
> Can anybody explain me this:
>
> i = image(/test, image_dimensions=[500,500], dimensions=[500,500])
> e1 = ellipse(0.5,0.5,major=0.5,minor=0.5, fill_transparency=50,fill_color='red',/norm,target=i, /relative)
> e2 = ellipse(0.5,0.5,major=0.5,minor=0.5, fill_transparency=50,fill_color='yellow',/norm,target=i, /relative)
>
> now rescale the window and change the window aspect ratio (make it for example larger).
>
> e2 = ellipse(0.5,0.5,major=0.5,minor=0.5, fill_transparency=50,fill_color='yellow',/norm,target=i, /relative)
>
> I would have expected e1 and e2 to be the same. According to the documentation for target:
> "Set this keyword to indicate that the input arguments are specified in normalized [0,1] coordinates, relative to the axis range of the TARGET's dataspace."
>
> What is the reason for this behavior? Bug or feature?
>
> Thanks,
> Helder
I think /NORM and /RELATIVE are mutually exclusive. Try getting rid of the /NORM for your two ellipse calls.
-Chris
|
|
|
Re: normal, relative and ellipse [message #90350 is a reply to message #90324] |
Wed, 25 February 2015 01:39  |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
Hi Chris,
thanks, that worked. Now (I think) I understand what that sentence in the documentation meant.
Helder
On Friday, February 20, 2015 at 4:27:18 PM UTC+1, Chris Torrence wrote:
> On Thursday, February 19, 2015 at 4:39:23 PM UTC-7, Helder wrote:
>> Hi,
>> I just thought that I found a bug, but then I though about it again and well... I stopped after a while.
>> Can anybody explain me this:
>>
>> i = image(/test, image_dimensions=[500,500], dimensions=[500,500])
>> e1 = ellipse(0.5,0.5,major=0.5,minor=0.5, fill_transparency=50,fill_color='red',/norm,target=i, /relative)
>> e2 = ellipse(0.5,0.5,major=0.5,minor=0.5, fill_transparency=50,fill_color='yellow',/norm,target=i, /relative)
>>
>> now rescale the window and change the window aspect ratio (make it for example larger).
>>
>> e2 = ellipse(0.5,0.5,major=0.5,minor=0.5, fill_transparency=50,fill_color='yellow',/norm,target=i, /relative)
>>
>> I would have expected e1 and e2 to be the same. According to the documentation for target:
>> "Set this keyword to indicate that the input arguments are specified in normalized [0,1] coordinates, relative to the axis range of the TARGET's dataspace."
>>
>> What is the reason for this behavior? Bug or feature?
>>
>> Thanks,
>> Helder
>
> I think /NORM and /RELATIVE are mutually exclusive. Try getting rid of the /NORM for your two ellipse calls.
>
> -Chris
|
|
|