X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 23 May 2011 09:48 PM by  anon
How save graphic without showing plot window in IDL 8.0?
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
23 May 2011 09:48 PM
    Hi guys: I want my IDL program to run in the background and produce graphic file (.png) without showing plot window. How do I get this? Very thanks! dave

    Deleted User



    New Member


    Posts:
    New Member


    --
    24 May 2011 07:21 AM
    Hello Dave, There two main ways do it, Instead of using the 'WIN' or 'X' buffer, you can use the 'Z' buffer or the PS to save as a postscript. Using Z buffer is really simple, see the example : myDevice = !D.NAME ; get device in use set_plot, 'Z' scrdim = [1400.,700.] loadct, 0, /SILENT !P.Background = 255 ERASE, 255 DEVICE, SET_PIXEL_DEPTH=24 DEVICE, SET_RESOLUTION=[scrdim[0],scrdim[1]] DEVICE, DECOMPOSED = 0 plot, indgen(5), indgen(5),$ xstyle = 1, ystyle = 1,$ color = 0, TICKLEN = -0.01 pngout = '~/filename.png' ; Output file WRITE_PNG, pngout, TVRD(TRUE = 1) DEVICE, /CLOSE set_plot, myDevice ; set the initial device Cheers, Vincent Sarago

    Deleted User



    New Member


    Posts:
    New Member


    --
    24 May 2011 05:57 PM
    Very thanks! Vincent Sarago. Is there any way to do this with the new graphics system?

    Deleted User



    New Member


    Posts:
    New Member


    --
    25 May 2011 03:29 AM
    Hello Dave, I think it's possible but you will have to use "Buffer = 1" to set an off-screen buffer. From Plot help : BUFFER (Init) Set this property to 1 to direct the graphics to an off-screen buffer instead of creating a window. Vincent
    You are not authorized to post a reply.