Re: cgimage not generating output with cgps_open and cgps_close (fine in X window) . [message #89477 is a reply to message #89474] |
Mon, 20 October 2014 12:52  |
JTMHD
Messages: 9 Registered: October 2014
|
Junior Member |
|
|
On Monday, 20 October 2014 19:06:14 UTC+1, David Fanning wrote:
> David Fanning writes:
>
>
>
>> Well, leave the XSCALE and YSCALE keywords off your cgImage command.
>
>> They aren't needed (cgImage does this automatically), and they are
>
>> somehow (don't understand it yet) screwing things up.
>
>
>
> Alright, here is what is happening. This is a combination of the usual
>
> keyword inheritance nonsense, with a little twist from IDL letting you
>
> abbreviate keyword names.
>
>
>
> The proper way to set axis properties in cgImage is via the AXKeywords
>
> keyword, which no one can figure out how to use. So I allow a *limited*
>
> number of axis keywords to be used on the cgImage command line (e.g.,
>
> xrange and yrange). I don't forbid you to use XSCALE and YSCALE keywords
>
> (the ol' keyword inheritance problem), but there should be no reason to
>
> use them, either. cgImage knows what it is doing and does axis things
>
> correctly.
>
>
>
> Had you actually used XSCALE and YSCALE keywords, instead of their
>
> shorted form XS and YS, you would have received an error message, since
>
> these keywords are passed along to the TV command. They don't mean
>
> anything to the TV command, so the TV command complains. But, in their
>
> shortened form, XS and YS, they are interpreted by the TV command as the
>
> XSIZE and YSIZE keywords, and they will overwrite the XSIZE and YSIZE
>
> values cgImage uses internally to size a PostScript image. (The XSIZE
>
> and YSIZE keywords are only used by the TV command when in the
>
> PostScript device.) As a result, and this is why you weren't getting an
>
> error, your image was being sized to a one-by-one pixel, which was being
>
> displayed correctly in your output. :-)
>
>
>
> 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.")
Hi David,
Thank you for reply - I can happily confirm that this fixes the problem. I guess the reason I've not came up against this in the past is that for some reason its only today that I've absent-mindedly stuck the xs=1,ys=1 keywords in despite not needing them (perhaps a habit from other plotting!).
I would just like to stress how much time I think your answer has saved me - I was copying and pasting the code from a little text file so who knows how long it would have been before I would have typed it out again without those keywords and perhaps noticed the culprit!
Thanks,
Jonathan
|
|
|