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

Home » Public Forums » archive » Re: Problem with labeling contour lines in IDL
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: Problem with labeling contour lines in IDL [message #65428] Wed, 04 March 2009 12:46 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
ed.schmahl@gmail.com writes:

> Maybe I'm doing something different, but this little script in Direct
> Graphics seems to produce nonlinear annotation almost correctly:
>
> d=3Dshift(dist(100),50,50)
> g=3Dexp(-d^2/400)
> c_annotat=3D['0.1','0.2','0.4','0.8','1.6','3','6','12','25' ,'50','98']
> lev =3D max(g)* float(c_annotat)/100.
> contour,g,c_annot=3Dc_annotat,lev=3Dlev
>
> The only thing wrong that I can see is that the .98 label doesn't
> appear, but all the other contours are labeled properly.

I think the word "linear" in Nusret's post was a red herring.
I like to think that contours need to be "long enough" to
be interrupted by a break for a contour label. What "long
enough" means is unclear, but I know for a fact we have no
control over it. In this case, you would see a contour label
for the 0.98 contour, if you made your window twice as big.

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: Problem with labeling contour lines in IDL [message #65430 is a reply to message #65428] Wed, 04 March 2009 12:34 Go to previous messageGo to next message
ed.schmahl is currently offline  ed.schmahl
Messages: 11
Registered: October 2008
Junior Member
On Mar 4, 7:10 am, David Fanning <n...@dfanning.com> wrote:
> Nusret Sevin writes:
>> I have a problem with labeling contour lines in IDL:
>> ...
>> Is there a way that I can force IDL to put labels on nonlinear parts?
>
> You have almost no control over contour line labeling
> in IDL direct graphics. If you want control, you are
> going to have to switch to object graphics. If I were
> going to do this, I would start with something like
> XContour, which is very old and needs to be updated,
> but which has many of the parts you will need already
> in place. Perhaps you can update it for the rest of us. :-)
>
>   http://www.dfanning.com/programs/xcontour.pro

Nusret, David,

Maybe I'm doing something different, but this little script in Direct
Graphics seems to produce nonlinear annotation almost correctly:

d=shift(dist(100),50,50)
g=exp(-d^2/400)
c_annotat=['0.1','0.2','0.4','0.8','1.6','3','6','12','25',' 50','98']
lev = max(g)* float(c_annotat)/100.
contour,g,c_annot=c_annotat,lev=lev

The only thing wrong that I can see is that the .98 label doesn't
appear, but all the other contours are labeled properly.

Ed Schmahl


>
> 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: Problem with labeling contour lines in IDL [message #65431 is a reply to message #65430] Wed, 04 March 2009 12:30 Go to previous messageGo to next message
ed.schmahl is currently offline  ed.schmahl
Messages: 11
Registered: October 2008
Junior Member
On Mar 4, 7:10 am, David Fanning <n...@dfanning.com> wrote:
> Nusret Sevin writes:
>> I have a problem with labeling contour lines in IDL:
>> ...
>> Is there a way that I can force IDL to put labels on nonlinear parts?
>
> You have almost no control over contour line labeling
> in IDL direct graphics. If you want control, you are
> going to have to switch to object graphics. If I were
> going to do this, I would start with something like
> XContour, which is very old and needs to be updated,
> but which has many of the parts you will need already
> in place. Perhaps you can update it for the rest of us. :-)
>
>   http://www.dfanning.com/programs/xcontour.pro
>
> 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: Problem with labeling contour lines in IDL [message #65443 is a reply to message #65431] Wed, 04 March 2009 06:10 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Nusret Sevin writes:

> I have a problem with labeling contour lines in IDL:
> ...
> Is there a way that I can force IDL to put labels on nonlinear parts?

You have almost no control over contour line labeling
in IDL direct graphics. If you want control, you are
going to have to switch to object graphics. If I were
going to do this, I would start with something like
XContour, which is very old and needs to be updated,
but which has many of the parts you will need already
in place. Perhaps you can update it for the rest of us. :-)

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

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: Problem with labeling contour lines in IDL [message #65548 is a reply to message #65428] Tue, 10 March 2009 01:57 Go to previous message
Nusret Sevinç is currently offline  Nusret Sevinç
Messages: 8
Registered: March 2009
Junior Member
On 4 Mart, 22:46, David Fanning <n...@dfanning.com> wrote:
> ed.schm...@gmail.com writes:
>> Maybe I'm doing something different, but this little script in Direct
>> Graphics seems to produce nonlinear annotation almost correctly:
>
>> d=3Dshift(dist(100),50,50)
>> g=3Dexp(-d^2/400)
>> c_annotat=3D['0.1','0.2','0.4','0.8','1.6','3','6','12','25' ,'50','98']
>> lev =3D max(g)* float(c_annotat)/100.
>> contour,g,c_annot=3Dc_annotat,lev=3Dlev
>
>> The only thing wrong that I can see is that the .98 label doesn't
>> appear, but all the other contours are labeled properly.
>
> I think the word "linear" in Nusret's post was a red herring.
> I like to think that contours need to be "long enough" to
> be interrupted by a break for a contour label. What "long
> enough" means is unclear, but I know for a fact we have no
> control over it. In this case, you would see a contour label
> for the 0.98 contour, if you made your window twice as big.
>
> 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.")

That is exactly what I mean David. Since I have a deadline for my work
very soon, I am going to label the lines with xyouts. After my work is
done, I will check your program and try to update it.

Thank you both for your interest,

Nusret Sevinç
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Use of ++ operator to count frequency of an entry (Was: Majority Voting)
Next Topic: Plotting over a lunar map

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

Current Time: Wed Oct 08 13:38:36 PDT 2025

Total time taken to generate the page: 0.00816 seconds