save problems [message #86623] |
Sun, 24 November 2013 02:00  |
Chrisss
Messages: 18 Registered: November 2013
|
Junior Member |
|
|
Hi!!!
I use IDL 8.2.2 and my questions are the following:
1- is possible to save plot and its oplot in the same .pdf (or png, jpeg, etc) file?
2- is possible to save tvscl window in a .pdf (or png, jpeg, etc) file?
thanks, Chrisss
|
|
|
Re: save problems [message #86624 is a reply to message #86623] |
Sun, 24 November 2013 07:06   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Chrisss writes:
> I use IDL 8.2.2 and my questions are the following:
>
> 1- is possible to save plot and its oplot in the same .pdf (or png, jpeg, etc) file?
> 2- is possible to save tvscl window in a .pdf (or png, jpeg, etc) file?
Oh, boy, are you in for a big surprise! And resizeable windows, too!
http://www.idlcoyote.com/graphics_tips/coyote_graphics.php
Here is how to put multiple commands in a single plot and save it in any
of the formats you mention:
http://www.idlcoyote.com/cg_tips/multicmds.php
With your image, just use the OUTPUT keyword and the appropriate
extension and everything is handled for you:
IDL> cgImage, image, /Scale, OUTPUT='myimage.pdf'
Cheers,
David
P.S. Where have you been all my life? I've been writing programs just
for you!
--
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: save problems [message #86647 is a reply to message #86624] |
Mon, 25 November 2013 14:28   |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
If you use function graphics (FG), then if you do something like
p = plot(x,y)
p = plot(x2,y2,/overplot)
you can save the generated plot in any of your required formats like so:
p.save, "plot.png"
p.save, "plot.pdf"
etc.
Same for other FG function like image, surface, etc.
The extension on the filename does all the hard work.
See http://www.exelisvis.com/docs/Save_Method.html
*BUT* - very importantly - if this question is in relation to your other
post, where you are generating many plots within a loop (using old style
direct graphics, DG), then ignore everything I said above and do what
DavidF suggested and use his Coyote Graphics (CG) tools.
Using function graphics in a loop will slow your script down by many
many orders of magnitude.
cheers,
paulv
On 11/24/13 10:06, David Fanning wrote:
> Chrisss writes:
>
>> I use IDL 8.2.2 and my questions are the following:
>>
>> 1- is possible to save plot and its oplot in the same .pdf (or png, jpeg, etc) file?
>> 2- is possible to save tvscl window in a .pdf (or png, jpeg, etc) file?
>
> Oh, boy, are you in for a big surprise! And resizeable windows, too!
>
> http://www.idlcoyote.com/graphics_tips/coyote_graphics.php
>
> Here is how to put multiple commands in a single plot and save it in any
> of the formats you mention:
>
> http://www.idlcoyote.com/cg_tips/multicmds.php
>
> With your image, just use the OUTPUT keyword and the appropriate
> extension and everything is handled for you:
>
> IDL> cgImage, image, /Scale, OUTPUT='myimage.pdf'
>
> Cheers,
>
> David
>
> P.S. Where have you been all my life? I've been writing programs just
> for you!
>
|
|
|
|
|
|
|
Re: save problems [message #86656 is a reply to message #86654] |
Tue, 26 November 2013 04:54  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst writes:
> Although it does make me realise how much crap I'm ready to put up with
> in my life.
>
> Goodness. I have no idea where that came from. Consequence of living in
> DC too long perhaps? :o\
I hear you, man. I'm going out today to cut trees off of a couple of ski
trails. That always helps. :-)
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.")
|
|
|