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

Home » Public Forums » archive » Re: usersym keywords -- why?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: usersym keywords -- why? [message #63427] Tue, 11 November 2008 05:28 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Reimar Bauer writes:

> Just a quick question why isn't it passed by _EXTRA ?

Oh, ok, *now* I see the point of that discussion
yesterday. Humm. Don't know. Let me go get some
coffee and think about it some. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: usersym keywords -- why? [message #63429 is a reply to message #63427] Tue, 11 November 2008 00:57 Go to previous messageGo to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning schrieb:
> Christopher Thom writes:
>
>> Debugging some code today, I discovered what I would consider to be
>> strange behaviour. Although...maybe this is a "feature". Consider the
>> following:
>>
>> usersym, [ -1, 0, 1, -1 ], [ 1, -1, 1, 1 ], thick = 20
>> plot, findgen(10), ps=8, thick = 2
>>
>> Is there any reason why usersym accepts thickness and color keywords? And,
>> more importantly, why the keywords passed to plot/oplot don't over-ride
>> them?
>>
>> I was using some symbols from the awesome symcat() library [thanks david!]
>> when I discovered this. The only workaround I could come up with was to
>> extend symcat() to accept and pass _extra keywords to usersym...which now
>> gives me the even more confusing:
>>
>> plot, findgen(10), ps = symcat(11, thick = 20), thick = 2
>>
>> If anyone can see a sane or (better!) elegant solution to the thickness
>> madness I've been having all afternoon, I'd love to hear of it.
>
> I can't really make out what you think the problem is.
> I think IDL is doing exactly the right and expected thing
> here: if I make a user symbol, I don't want someone outside
> messing around with it.
>
> Why did you have to extend SYMCAT? It already takes the THICK
> keyword.
>
> Cheers,
>
> David
>

Just a quick question why isn't it passed by _EXTRA ?

Reimar
Re: usersym keywords -- why? [message #63435 is a reply to message #63429] Mon, 10 November 2008 18:19 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Christopher Thom writes:

> Debugging some code today, I discovered what I would consider to be
> strange behaviour. Although...maybe this is a "feature". Consider the
> following:
>
> usersym, [ -1, 0, 1, -1 ], [ 1, -1, 1, 1 ], thick = 20
> plot, findgen(10), ps=8, thick = 2
>
> Is there any reason why usersym accepts thickness and color keywords? And,
> more importantly, why the keywords passed to plot/oplot don't over-ride
> them?
>
> I was using some symbols from the awesome symcat() library [thanks david!]
> when I discovered this. The only workaround I could come up with was to
> extend symcat() to accept and pass _extra keywords to usersym...which now
> gives me the even more confusing:
>
> plot, findgen(10), ps = symcat(11, thick = 20), thick = 2
>
> If anyone can see a sane or (better!) elegant solution to the thickness
> madness I've been having all afternoon, I'd love to hear of it.

I can't really make out what you think the problem is.
I think IDL is doing exactly the right and expected thing
here: if I make a user symbol, I don't want someone outside
messing around with it.

Why did you have to extend SYMCAT? It already takes the THICK
keyword.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: usersym keywords -- why? [message #63569 is a reply to message #63429] Tue, 11 November 2008 07:13 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Reimar Bauer writes:

> Just a quick question why isn't it passed by _EXTRA ?

The keywords THICK and COLOR are not passed by _EXTRA because
if you use them on the IDL command line, they are not "extra":

Plot, data, PSYM=SYMCAT(4), THICK=2, COLOR=200

Thus, I can't get them inside my program. But, that said,
I can understand some of Chris's confusion, because the
THICK keyword only applies to symbols I can create with
USERSYM. (Any symbol where I have to "lift the pen" to
draw cannot be created in USERSYM, such as a plus sign
or an asterisk.)

In fooling around with this today, I realized that if I
had added the COLOR keyword, too, I would have something
that was even more powerful, so I have done that:

http://www.dfanning.com/programs/symcat.pro

This gives me the ability to independently set the
thickness of the line, and the thickness of the symbols
(at least for those symbols I can render with USERSYM):

Plot, findgen(11), THICK=1, PSYM=-SYMCAT(4, THICK=2)

and it gives me the opportunity to draw the line in one color
and the symbols with another, without having to do this on
two separate calls:

yellow = FSC_Color('yellow')
green = FSC_Color('green')
Plot, Findgen(11), Color=yellow, PSYM=-SYMCAT(4, COLOR=green)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: latitude, longitude and a data point
Next Topic: Re: IDL and sqlite

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

Current Time: Wed Oct 08 19:05:01 PDT 2025

Total time taken to generate the page: 0.00599 seconds