[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PLOTs with colour regions

I was wondering if people have had to do this in the past, and so have
written something to do it. 

I'm wanting to plot some data, and at a certain threshold value, the
line colour must turn from being say white to red. That is to say I
don't just want to plot the data points above the threshold in red and
those below in white, I also want the connecting lines to be a
different colour as well.

The only way I could do it is as follows:
PLOT, data, /NODATA, POSITION=[0.2,0.2,0.8,0.8], yrange=[-4,4],

PLOT, data, /NOERASE, yrange=[0,4], ystyle=5,
POSITION=[0.2,0.5,0.8,0.8], COLOR=130, xstyle=4

PLOT, data, /NOERASE, yrange=[-4,0], ystyle=5,
POSITION=[0.2,0.2,0.8,0.5], COLOR=255, xstyle=4

.......or something roughly like that - I'm trying desperately to
remember the commands.

Anyway that's a bit messy really to hev in a general format and I was
wondering if anyone's got a better way or has done it before?