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

Home » Public Forums » archive » save problems
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
save problems [message #86623] Sun, 24 November 2013 02:00 Go to next message
Chrisss is currently offline  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 Go to previous messageGo to next message
David Fanning is currently offline  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 #86625 is a reply to message #86623] Sun, 24 November 2013 15:11 Go to previous messageGo to next message
Chrisss is currently offline  Chrisss
Messages: 18
Registered: November 2013
Junior Member
thank you so much David!
I'm a new idl user and I'm new in the world of programmers...so I don't know a lot of simple things. I'm sorry.
thanks, Christina
Re: save problems [message #86647 is a reply to message #86624] Mon, 25 November 2013 14:28 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  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 #86648 is a reply to message #86647] Mon, 25 November 2013 14:40 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> Using function graphics in a loop will slow your script down by many
> many orders of magnitude.

The slowest part may be dealing with transient abnormalities. Did you
ever get your THICK=2 problem sorted out?

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.")
Re: save problems [message #86653 is a reply to message #86647] Tue, 26 November 2013 02:47 Go to previous messageGo to next message
Chrisss is currently offline  Chrisss
Messages: 18
Registered: November 2013
Junior Member
MR Paul van Delst , thanks for your reply!
this my question is not in relation to my other post.
using old style direct graphics, DG, I resolved my "save plots problem" as you said :-)
but I can't apply it for an image generated with "TVSCL", why? :-(
Cheers,
Christina
Re: save problems [message #86654 is a reply to message #86648] Tue, 26 November 2013 03:57 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Nope. You deal and move on.

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\

cheers,

paulv

On 11/25/13 17:40, David Fanning wrote:
> Paul van Delst writes:
>
>> Using function graphics in a loop will slow your script down by many
>> many orders of magnitude.
>
> The slowest part may be dealing with transient abnormalities. Did you
> ever get your THICK=2 problem sorted out?
>
> Cheers,
>
> David
>
>
Re: save problems [message #86655 is a reply to message #86654] Tue, 26 November 2013 04:29 Go to previous messageGo to next message
Chrisss is currently offline  Chrisss
Messages: 18
Registered: November 2013
Junior Member
Thanks for your consideration
Re: save problems [message #86656 is a reply to message #86654] Tue, 26 November 2013 04:54 Go to previous message
David Fanning is currently offline  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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Unexpected negative values when reading txt file
Next Topic: lamda default value in CURVEFIT function

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

Current Time: Wed Oct 08 11:33:19 PDT 2025

Total time taken to generate the page: 0.00548 seconds