X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 11 May 2015 12:17 PM by  anon
Plot image/Graphics directly to a *.png file
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
11 May 2015 12:17 PM
    Dear Sir I wish to save my graphics directly to a image file (file format is not important), as first displaying it in a window and then saving it to in image file takes a lot of time. Is there a way this can be achieved. I am using IDL version 8.2.3. Regards Piyush

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    11 May 2015 02:59 PM
    Hello Piyush, You can use the save method for graphics. Here is a link to the documentation which contains an example: http://www.exelisvis.com/docs/save_method.html

    Deleted User



    New Member


    Posts:
    New Member


    --
    11 May 2015 04:02 PM
    Hi Zach Thanks for the reply. The "save" method is what i have been using lately. But this requires to first plot the image in a graphics window and then save it. I was asking if there is a way to save the image directly to a file without first opening a graphics window (as python users do) ? Piyush

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    12 May 2015 07:59 AM
    Piyush, You can use the "/buffer" keyword in your plot call which makes the plot in memory without displaying it. From here, you can use the save method as you have with your other graphics. A sample of using the buffer keyword would be something like: p = plot(/test, /buffer)

    Deleted User



    New Member


    Posts:
    New Member


    --
    12 May 2015 02:23 PM
    Dear Zach Thank you so much for the help. I have no clue where the hell my mind was, when I was reading the documentation. Thanks though. Piyush
    You are not authorized to post a reply.