Automatic Output to PS and Raster in Coyote Graphics [message #78565] |
Fri, 09 December 2011 10:40  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
Yesterday's announcement of big changes in Coyote Graphics
routines was so...well, let's just say this is a pretty
hard group to impress. So, Coyote and I decided to pull
an all-nighter and come up with something REALLY good
for you. (Most of Coyote's suggestions were, you know,
not appropriate, but nothing new there!)
Anyway, we are trying again today with the announcement
that Coyote Graphic routines can now send their output
*directly* to PostScript and raster output files via
a new OUTPUT keyword. The allowed values are:
'PS' - PostScript file
'EPS' - Encapsulated PostScript file
'PDF' - PDF file
'BMP' - BMP raster file
'GIF' - GIF raster file
'JPEG' - JPEG raster file
'PNG' - PNG raster file
'TIFF' - TIFF raster file
You will be asked for the name of the output file,
unless you specify it with the OUTFILENAME keyword.
The following Coyote Graphics routines allow this
functionality: cgBarPlot, cgBoxPlot, cgHistoPlot,
cgPlot, cgContour, cgImage, cgSurf, and cgShadeSurf.
This functionality assumes you have the usual
third-party conversion software (ImageMagick
and Ghostview or the equivalent) installed. It
should not be used for multiple plots. It is really
just a convenience for creating a single plot in
a PostScript or raster file.
Taking advantage of the new OUTLINE keyword to
cgContour, here is how you could make a PNG file
of a filled contour plot:
cgLoadCT, 33, NColors=8, Bottom=1
cgContour, cgDemoData(2), NLevels=8, C_Colors=Indgen(8)+1, $
/Fill, /Outline, Output='PNG', Outfilename='cgcontour.png'
As usual, Coyote Graphics documentation is here:
http://www.idlcoyote.com/idldoc/cg/index.html
And the Coyote Library code is here:
http://www.idlcoyote.com/programs/zip_files/coyoteprograms.z ip
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.")
|
|
|
Re: Automatic Output to PS and Raster in Coyote Graphics [message #78741 is a reply to message #78565] |
Sun, 11 December 2011 18:40  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> Anyway, we are trying again today with the announcement
> that Coyote Graphic routines can now send their output
> *directly* to PostScript and raster output files via
> a new OUTPUT keyword. The allowed values are:
>
> 'PS' - PostScript file
> 'EPS' - Encapsulated PostScript file
> 'PDF' - PDF file
> 'BMP' - BMP raster file
> 'GIF' - GIF raster file
> 'JPEG' - JPEG raster file
> 'PNG' - PNG raster file
> 'TIFF' - TIFF raster file
There have been a couple of tweaks to this functionality
over the weekend to make the functionality even easier
to use. For example, now you can use the OUTPUT keyword
to specify both the type of file output and the name
of the output file:
cgPlot, cgDemodata(1), Output='myplot.png'
cgSurf, cgDemodata(2), Output='mysurface.tif'
cgImage, cgDemodata(7), /Axes, Output='myimage.pdf'
Here is an article that describes the functionality
in a bit more detail:
http://www.idlcoyote.com/cg_tips/cgoutput.php
cgWindow and cgControl have both also been updated
to all programmatic control of all supported types
of output.
You will need to update your Coyote Library to use
the functionality:
http://www.idlcoyote.com/programs/zip_files/coyoteprograms.z ip
And you will need third party software to do the conversions
to PDF and raster file types. Details in the articles.
This is the cat's meow on my machine. Let me know if you
are having any problems getting it to work on yours.
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.")
|
|
|