X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 11 Jun 2013 09:08 AM by  anon
IDL Plot function
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:33
New Member


--
11 Jun 2013 09:08 AM
    I'm working on an application. I'm most of the way done, but I can't seem to be able to programatically determine if/when the plot function has drawn a window, so I get somewhat unexpected behavior. This is a widget, and if I could get that under control, all would be golden. Right now, sometimes I can get the behavior to work correctly, and sometimes not. I've tried the wait command; I also see that there's a /buffer option to plot, but it is not clear to me what I do if I use /buffer, how do I finally get the plots drawn? Just curious what folks have done while programatically using the plot function in order to get the plot setup and drawing only what is needed.

    Deleted User



    New Member


    Posts:
    New Member


    --
    11 Jun 2013 09:27 AM
    It sounds to me like you are letting the Plot function create its own graphics window. That is the wrong way to write a widget program, because you have no control over that window. Instead, you should be creating your own graphics window (Widget_Window) to draw the plot in. That way, when you exit the event handler that draws the plot, you will *know* you have drawn the plot! (Actually, you will know it in the event handler, because the Plot function won't return to you until the plot has been drawn.) Be sure to put up an hourglass cursor while the Plot function is executing. If it is the first Plot command, it can take a while.

    Deleted User



    New Member


    Posts:33
    New Member


    --
    13 Jun 2013 10:24 AM
    David, I didn't know anyone replied! I ended up doing the solution that you stated, even without seeing it - except for the hourglass; I'll need to look into that. The whole problem was, as you state, that the first plot command was taking some time, and I was ending up with plots I didn't want - or even multiple Plot Windows I didn't want. The solution you suggest does work as advertised. Thanks, -M
    You are not authorized to post a reply.