Multicolored dashed lines??? [message #45551] |
Wed, 21 September 2005 13:44  |
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  |
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  |
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  |
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 #45696 is a reply to message #45551] |
Wed, 21 September 2005 19:55  |
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/
|
|
|
|