Re: oplot with colours [message #67477] |
Thu, 30 July 2009 21:08  |
b.a
Messages: 26 Registered: July 2009
|
Junior Member |
|
|
On Jul 31, 1:29 pm, "b.a" <u4565...@anu.edu.au> wrote:
> Hi,
>
> I am writing a program (using IDL workbench) and I have two questions
> about plotting data. I appreciate if anyone can help.
>
> 1) In my program, I need to plot several data on the same draw window.
> I know that oplot does this but even for the first curve, I don't want
> to use plot. Is there anyway that I ignore having plot for the first
> one and then using oplot?
>
> 2) For each curve, I want to have different colour and on the draw
> window, I need to show that each colour represents which curve.
>
> Thank you
> Afra
I also want to remove the plot by licking on a button. do we have
anything like "diplot" to remove the selected curve?
|
|
|
Re: oplot with colours [message #67478 is a reply to message #67477] |
Thu, 30 July 2009 21:07   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
b.a writes:
> 1) In my program, I need to plot several data on the same draw window.
> I know that oplot does this but even for the first curve, I don't want
> to use plot. Is there anyway that I ignore having plot for the first
> one and then using oplot?
You don't have to draw a plot. But you do have to have some
way of setting up the data coordinate system, so you have
something to overplot *on*. Do you have an alternative
method?
You can, of course, draw a plot in which nothing appears.
This, basically, just sets up the data coordinate system
for you:
Plot, [0,1], /NoData, YSTYLE=4, XSTYLE=4, XRANGE=[0,10], YRANGE=[0,1]
> 2) For each curve, I want to have different colour and on the draw
> window, I need to show that each colour represents which curve.
Well, you need a legend. You can probably find one ready-
built in the IDL software libraries that can be found on the
Internet, or you can just build your own legend with a combination
of PLOTS and XYOUTS commands.
Plots, [0.1, 0.2], [0.85, 0.85], /Normal, Color=FSC_Color('red')
XYOUTS, 0.21, 0.84, /Normal, 'Red indicates danger'
Plots, [0.1, 0.2], [0.80, 0.80], /Normal, Color=FSC_Color('blue')
XYOUTS, 0.21, 0.79, /Normal, 'Blue indicates safety'
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: oplot with colours [message #67570 is a reply to message #67478] |
Thu, 30 July 2009 23:22  |
b.a
Messages: 26 Registered: July 2009
|
Junior Member |
|
|
Thanks David, I used
Plot, [0,1], /NoData, YSTYLE=4, XSTYLE=4, XRANGE=[0,10], YRANGE=[0,1]
and it fixed the first problem. But is there any way that I can
selectively remove the plotted curves? for example, by clicking the
button relevant to each curve, I want it to be off the draw window.
Cheers
Afra
|
|
|