Re: Multicolored dashed lines??? [message #45548] |
Wed, 21 September 2005 14:19 |
R.G. Stockwell
Messages: 363 Registered: July 1999
|
Senior Member |
|
|
"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
Hi Haje,
perhaps something along the lines of:
(using the findgen functions as x and y)
plots,findgen(100),findgen(100) + 5,linestyle=5,color=(findgen(100) mod
2)*255
ie make an array of color that = [0,255,0,255] so that the dashes go
[black,white,black,white]
(at least for my color table, color=255 is white]. Easy to extend tothree or
more
colors too.
I've had to make symbols that could be seen both against a white background
and a black background,
so I just make a white circle, and overplotted with a black cross, something
like that would work too.
Cheers,
bob
|
|
|
|
Re: Multicolored dashed lines??? [message #45550 is a reply to message #45549] |
Wed, 21 September 2005 14:03  |
savoie
Messages: 68 Registered: September 1996
|
Member |
|
|
"Haje Korth" <haje.korth@nospam.jhuapl.edu> writes:
> 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.
Would this work?
x = randomn( 3, 333 )
plot, x, BACKGROUND = fsc_color( 'red', 1 ), $
COLOR = fsc_color( 'blue', 2 )
oplot, [ 0, 1000 ], [ 0, 0 ], $
COLOR = fsc_color( 'black', 3 )
oplot, [ 0, 1000 ], [ 0, 0 ], $
COLOR = fsc_color( 'white', 3 ), LINESTYLE = 2
See dfanning.com for fsc_color.pro
Matt
--
Matthew Savoie - Scientific Programmer
National Snow and Ice Data Center
(303) 735-0785 http://nsidc.org
|
|
|