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

Home » Public Forums » archive » multi-color (time-series) line plot
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: multi-color (time-series) line plot [message #77143 is a reply to message #77070] Wed, 03 August 2011 15:37 Go to previous message
Mark Piper is currently offline  Mark Piper
Messages: 198
Registered: December 2009
Senior Member
On 8/2/2011 3:01 AM, Teddy Allen wrote:
> Dear group,
> I have a very simple question that I am having trouble resolving
> (maybe because it is almost 2am)...I have a time series of 500
> points. I would like to plot a line plot that has 0:299 in red and
> 300:499 in blue. Basically, I would like a continuous time series line
> plot that changes color at a specific location.
>
> p = plot(rainall, xrange=[0,299],color='red')
> p1 = plot(rainall, xrange=[300,499],color='blue',/over)
>
> The above does not seem to work and I have played around with the
> xrange option in addition to the xstyle option. Any hints for this
> elementary request?
> thank you,
> teddy

Hi Teddy,

Please try this:

enso = read_binary(file_which('elnino.dat'), data_type=4) ; 500 elts
time = findgen(n_elements(enso))
p_red = plot(time[0:299], enso[0:299], color='red')
p_blue = plot(time[300:*], enso[300:*], color='blue', /overplot)

I had to introduce the "x" parameter to make this work correctly.

mp
[Message index]
 
Read Message
Read Message
Previous Topic: Segregating data in bimodal distribution
Next Topic: Re: iPlot Axes Colour

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

Current Time: Fri Oct 10 14:02:19 PDT 2025

Total time taken to generate the page: 0.95996 seconds