comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » question on exactly when !p.position is defined
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
question on exactly when !p.position is defined [message #85216] Mon, 15 July 2013 14:17 Go to next message
astroboy.20000 is currently offline  astroboy.20000
Messages: 39
Registered: August 2012
Member
Hello,

Apologies in advance if this topic has been addressed before but I haven't been able to find it.

I'm just not clear on when !p.position is defined, despite doing of reading and experimentation.

I've written a routine that collects the !p,!xyz and !m and !d.window variables into a structure so that I can go back to an earlier (multi) plot and overplot, using the original !xyz axis values. It works fine, except for the !p.position variable.


It seems to be that one should be able to do something like this:

!p.multi=[0,2,2]
plot,findgen(10)

print,!p.position


and have !p.position give the plot-data window of the plot just made.... However, the values are [0,0,0,0] instead of something like [.05,.05,.9,.9].


Of course, I've used the position and !p.position variables to locate a plot on a page, so at least I understand how things work in that application.

However, I guess I'm just not clear on how to obtain the position coordinates of a plot just made....

Thanks in advance. This might sound like a trivial problem but if I could solve it, it would be a big help.
Re: question on exactly when !p.position is defined [message #85217 is a reply to message #85216] Mon, 15 July 2013 14:37 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
astroboy.20000@gmail.com writes:

> Of course, I've used the position and !p.position variables to locate a plot on a page, so at least I understand how things work in that application.
>
> However, I guess I'm just not clear on how to obtain the position coordinates of a plot just made....

Unfortunately, unless you use, for example, cgLayout, you have to do
this after the fact. First, draw the plot:

cgPlot, ....

Then, capture the position of the plot:

plotPosition = [!X.Window[0], !Y.Window[0], $
!X.Window[1], !X.Window[1]]

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: question on exactly when !p.position is defined [message #85218 is a reply to message #85217] Mon, 15 July 2013 14:41 Go to previous message
astroboy.20000 is currently offline  astroboy.20000
Messages: 39
Registered: August 2012
Member
On Monday, July 15, 2013 5:37:45 PM UTC-4, David Fanning wrote:
> astroboy.20000@gmail.com writes:
>
>
>
>> Of course, I've used the position and !p.position variables to locate a plot on a page, so at least I understand how things work in that application.
>
>>
>
>> However, I guess I'm just not clear on how to obtain the position coordinates of a plot just made....
>
>
>
> Unfortunately, unless you use, for example, cgLayout, you have to do
>
> this after the fact. First, draw the plot:
>
>
>
> cgPlot, ....
>
>
>
> Then, capture the position of the plot:
>
>
>
> plotPosition = [!X.Window[0], !Y.Window[0], $
>
> !X.Window[1], !X.Window[1]]
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

Thanks very much David, I can certainly do that (although it's a bit of a pain, but that's why programmers are paid such enormous salaries!)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Name and favourite colour
Next Topic: fill_background in TEXT reference does not work

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:34:36 PDT 2025

Total time taken to generate the page: 0.00511 seconds