Re: Question about cgplot output to file [message #76280] |
Fri, 27 May 2011 09:36 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst writes:
> I have two questions:
>
> 1) How do you change the default location of the output when you select the "Save Window As" option?
Well, when you chose the Save option, you will get
a file selection tool that will allow you to change
the name of the file, it's location, etc. Although
this tool *looks* like Dialog_Pickfile, it is actually
FSC_Pickfile. The difference is that FSC_Pickfile
"remembers" the last location (folder or directory)
where you saved or opened a file.
What this means is that if you choose a different
location to save a file, then the next time you
choose to save a file, it should start in this
new location. In other words, you can "dynamically"
change the default location.
The first time you run the program, it will choose
the current directory as the starting location. Is it
this location you wish to change?
It might take 15 minutes to add this feature, if you
think it is something you need.
> 2) How do you programmatically create the output file. I.e. how do you save the output file from the command line, or
> within an application?
Well, it is the cgWindow program that can create output
from the commands. If you are using the cgWindow program,
I'm not sure why you want programmatic output, although
I did add this at someone's suggestion (Gray?). The
way you do it is with cgControl and the Create_***
keywords. Here is how you would do it for the current
cgWindow:
cgControl, Create_PNG='/user/david/myoutput.png'
The keyword Create_PS will create a PostScript file.
I note that the Coyote Graphics 2.0 routine cgsPlot
has SAVE and PS methods that can save raster and
PostScript files from the plot command directly, without
requiring a window.
p = cgsPlot(data)
p.save, '/user/david/myoutput.png'
p.ps, '/user/david/myoutput.ps
These Coyote Graphics 2.0 programs are here:
http://www.idlcoyote.com/programs/experimental
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|