Re: Problem in creating Postscript of "Transparent Histograms" [message #76534] |
Thu, 16 June 2011 14:24  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Poonam Chandra writes:
> I am creating transparent histogram plots using Coyote's tutorial
> ( http://www.idlcoyote.com/graphics_tips/overlaphisto.html ). It works
> fine but when I try to create it in Coyote's resizable window, the
> command cgSnapshot fails. I tried it in PostScript environment since I
> needed a ps output but the command fails again. This seems to work
> only in default IDL graphics window. But what good is a plot, if I
> cannot save it.
You are right, cgSnapshot doesn't save things in EPS.
But, I don't see any reason you can't save the plot
in a PostSript file. I know you reported it "doesn't work",
but that doesn't give me much to work with. The method you
are using doesn't contain any routines that don't work
in a PostScript file for me. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
|
|
|
Re: Problem in creating Postscript of "Transparent Histograms" [message #76539 is a reply to message #76534] |
Thu, 16 June 2011 10:21   |
Poonam Chandra
Messages: 12 Registered: June 2011
|
Junior Member |
|
|
On Jun 16, 12:47 pm, David Fanning <n...@dfanning.com> wrote:
>
> cgSnapshot fails because cgWindow is "protecting" itself
> against unwanted intrusion. To take a snapshot of a cgWindow,
> you need to get the window ID and use it like this:
>
> cgPlot, cgDemoData(1), /Window
> wid = cgQuery(/Current)
> snap = cgSnapShot(/PNG, WID=wid)
Thanks David. But looks like snapshot can be saved in PNG format only
and not in EPS format. Am I
correct? Changing PNG to EPS in ImageMagic results in a big quality
compromise and the file size is very large.
Thanks
Poonam
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thue. ("Perhaps thos speakest truth.")
|
|
|
|
Re: Problem in creating Postscript of "Transparent Histograms" [message #76774 is a reply to message #76534] |
Sat, 02 July 2011 13:50  |
Phillip Bitzer
Messages: 223 Registered: June 2006
|
Senior Member |
|
|
I ran into this problem a couple months back. I couldn't figure out how to use BlendImage with EPS files, as they're not *really* images in the sense that TVImage would handle (well). When I generated images first (say in the buffer), blended them, and stuck that into the EPS file, I lost the "nice-ness" that EPS gives you.
I got around this by using Histoplot (naturally) twice for my EPS file; one call used solid bars for the histogram using the fill keyword, while the second used "transparent" bars by utilizing the line_fill keyword. Something like:
HISTOPLOT, data, AXISCOLORNAME='black', YTITLE='Number of Sources', MAX_VAL=max_cumul_histo, POLYCOLOR='blue', /FILL, DATACOLORNAME='blue'
HISTOPLOT, data2, /OPLOT, POLYCOLOR='red', /LINE_FILL, ORIENTATION=[-45, 45], SPACING=.1, THICK=3, DATACOLORNAME='red'
I stuck this between the very handy PS_Start and PS_End, and it worked just fine, both on screen and in the EPS file.
I should note I have not gone back and tried this with Coyote Graphics (yet), as I was in the middle of generating plots for my dissertation. I should also note I'm fairly certain that I would never had been to complete said dissertation without the help of Coyote. :-)
|
|
|