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

Home » Public Forums » archive » PLOT() function...which WINDOW() to plot to...?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
PLOT() function...which WINDOW() to plot to...? [message #81352] Wed, 12 September 2012 06:56 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Hello,

I have some code that does this:

; Set the graphics buffering
buffer = KEYWORD_SET(png)

then, inside some loops (director and file lists), a window is created
like so:

w = WINDOW( $
WINDOW_TITLE = rts_file_list[i], $
DIMENSIONS = [800,w_ysize], $
BUFFER = buffer )

and then inside an addition loop (data items), a plot is created like so:

index++
pn = PLOT( $
channel_index, new_data, $
XTITLE=xtitle, $
TITLE = item_name[j], $
LAYOUT = [ n_col, n_row, index ], $
NAME = legend_name[0], $
COLOR = 'red', $
THICK = 2, $
CURRENT = w )

Note in the last command the keyword assignment "CURRENT = w".

And then finally,

IF ( buffer ) THEN $
w.SAVE, dir_list[n] + PATH_SEP() + $
FILE_BASENAME(file_root,".bin") + ".png", $
HEIGHT=w_ysize


Note that the main procedure keyword "png" is what determines whether or
not the plots got to a window on screen, or to a buffer. And, if they go
to a buffer, those plots are then saved as a png file.

I have noticed two things:

1) If I have existing graphics windows on screen (say from a bunch of
previous plots) and I run my program to create more onscreen plots, then
if I click on any of the *other* windows, my current plotting run
starts plotting to *that* window, not the one defined by the graphics id
variable "w".

2) If I set the "png" keyword to plot to the buffer so as to create
output files (and thus no onscreen output), if I again click on *any*
existing windows on screen, it becomes the target of the plotting
commands and my new plots get overwritten on anything existing onscreen.
Needless to say the final png output is also screwy.

Now, checking the PLOT() documentation it does not mention at all that
the CURRENT keyword is anything but a binary keyword (unlike the
OVERPLOT keyword where you can specify graphics references).

Fair enough. But, then, how does one set the current plotting window
such that inadvertent, or purposeful, clicks on some other existing
window doesn't cause the plotting to transfer to that window?

I want to create a window, and have everything plot in that window (be
it onscreen or in buffer) regardless of what other graphics windows I
have onscreen that I happen to be looking at and click on.

I presume there is some magical combination of keywords that will do that?

Thanks for any info.

cheers,

paulv
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Coyote Updates
Next Topic: Is IDL 8.2 Workbench Slow, Too?

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

Current Time: Fri Oct 10 06:46:31 PDT 2025

Total time taken to generate the page: 1.83927 seconds