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

Home » Public Forums » archive » Multicolored dashed lines???
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
Multicolored dashed lines??? [message #45551] Wed, 21 September 2005 13:44 Go to next message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Hi,
Before I start coding something really crappy, I wanted to ask if anyone has
a routine that can plot a multicolored dashed line (e.g., black-white)? The
purpose is to have a line that can be seen against arbitrary background
colors, such as used in a color spectrogram.

Thanks,
Haje
Re: Multicolored dashed lines??? [message #45690 is a reply to message #45551] Thu, 22 September 2005 05:33 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
I take back what I just said, no linestyle bug in IDL. My coffee must not
have made its way in my system yet. The pixelation was just due to
specifying a color array with 100000 elements. Duh....

Haje


"Haje Korth" <haje.korth@nospam.jhuapl.edu> wrote in message
news:dgu7o9$pbq$1@aplcore.jhuapl.edu...
> Good morning,
> Thanks for everyone's help. Both Matt's and Bob's solutions work. I ran
> into an additional problem, which made me go with the PLOTS procedure and
> the color array Bob suggested.
>
> The problem is that if the array to be plotted has a lot of elements, say
> 100000, the long dashed lines are turned into tiny pixels. This is clearly
> a bug in IDL (this is v6.2 on Windoze) since the appearance of the line
> should be independent of the size of the array. Right?
>
> However, Bob's solution can be adapted to create a workaround to the
> problem. That, is create the pattern first using a smaller array and then
> blow it up with congrid. In the solution below there are always 100
> dashes:
>
> plots,findgen(100000l),findgen(100000l) +
> 5,linestyle=5,color=congrid((findgen(100) mod 2)*255,100000l)
>
>
> Thanks and Cheers,
> Haje
>
>
> "Haje Korth" <haje.korth@nospam.jhuapl.edu> wrote in message
> news:dgsgmn$s9c$1@aplcore.jhuapl.edu...
>> Hi,
>> Before I start coding something really crappy, I wanted to ask if anyone
>> has a routine that can plot a multicolored dashed line (e.g.,
>> black-white)? The purpose is to have a line that can be seen against
>> arbitrary background colors, such as used in a color spectrogram.
>>
>> Thanks,
>> Haje
>>
>
>
Re: Multicolored dashed lines??? [message #45691 is a reply to message #45551] Thu, 22 September 2005 05:23 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Good morning,
Thanks for everyone's help. Both Matt's and Bob's solutions work. I ran into
an additional problem, which made me go with the PLOTS procedure and the
color array Bob suggested.

The problem is that if the array to be plotted has a lot of elements, say
100000, the long dashed lines are turned into tiny pixels. This is clearly a
bug in IDL (this is v6.2 on Windoze) since the appearance of the line should
be independent of the size of the array. Right?

However, Bob's solution can be adapted to create a workaround to the
problem. That, is create the pattern first using a smaller array and then
blow it up with congrid. In the solution below there are always 100 dashes:

plots,findgen(100000l),findgen(100000l) +
5,linestyle=5,color=congrid((findgen(100) mod 2)*255,100000l)


Thanks and Cheers,
Haje


"Haje Korth" <haje.korth@nospam.jhuapl.edu> wrote in message
news:dgsgmn$s9c$1@aplcore.jhuapl.edu...
> Hi,
> Before I start coding something really crappy, I wanted to ask if anyone
> has a routine that can plot a multicolored dashed line (e.g.,
> black-white)? The purpose is to have a line that can be seen against
> arbitrary background colors, such as used in a color spectrogram.
>
> Thanks,
> Haje
>
Re: Multicolored dashed lines??? [message #45694 is a reply to message #45551] Wed, 21 September 2005 20:23 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Andrew Cool writes:

> No, no, no David!
>
> BSDSP doesn't need marching ants.
>
> You've got better things to be getting on with... ;-)

No, with objects it's a five minute job! ;-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Multicolored dashed lines??? [message #45695 is a reply to message #45551] Wed, 21 September 2005 20:10 Go to previous message
Andrew Cool is currently offline  Andrew Cool
Messages: 219
Registered: January 1996
Senior Member
No, no, no David!

BSDSP doesn't need marching ants.

You've got better things to be getting on with... ;-)

Andrew
Re: Multicolored dashed lines??? [message #45696 is a reply to message #45551] Wed, 21 September 2005 19:55 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Andrew Cool writes:

> Have a look at the "Marching Ants" thread from Sep 6 2002. I posted a
> direct graphics
> routine for a marching ants ROI that you should be able to modify
> easily.

Odd that you should mention that, Andrew, because after
reading the thread today it suddenly occurred to me that I could
make the marching ants thing work in one of my objects.
I might give it a try. It's a little more "Hollywood" than
I normally care to be, but maybe it has a purpose somewhere.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Multicolored dashed lines??? [message #45697 is a reply to message #45551] Wed, 21 September 2005 19:43 Go to previous message
Andrew Cool is currently offline  Andrew Cool
Messages: 219
Registered: January 1996
Senior Member
Haje,

Have a look at the "Marching Ants" thread from Sep 6 2002. I posted a
direct graphics
routine for a marching ants ROI that you should be able to modify
easily.


Cheers,

Andrew
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Spin button widget??
Next Topic: Crisp characters in iTools

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

Current Time: Sun Oct 12 00:39:44 PDT 2025

Total time taken to generate the page: 1.36224 seconds