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

Home » Public Forums » archive » cgimage not generating output with cgps_open and cgps_close (fine in X window) .
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: cgimage not generating output with cgps_open and cgps_close (fine in X window) . [message #89475 is a reply to message #89474] Mon, 20 October 2014 11:14 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>
> 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. :-)

By the way, when you write code like this:

cgimage, image, /xs, /ys

You are doing two things wrong in my opinion. You are abbreviating
keyword names, which makes your programs difficult to understand and
debug (see current discussion today), and you are using a keyword
shortcut that is inappropriate with non-boolean keywords that can have
values *other* than 0 or 1. It works, but it strikes me as a lousy
programming practice, since it, too, sends the wrong message to people
looking for problems in your programs.

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.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: File time issue
Next Topic: cgWindRose has error producing legend?

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

Current Time: Wed Oct 08 16:23:53 PDT 2025

Total time taken to generate the page: 0.00194 seconds