oplot with colours [message #67483] |
Thu, 30 July 2009 20:29  |
b.a
Messages: 26 Registered: July 2009
|
Junior Member |
|
|
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
|
|
|
Re: oplot with colours [message #67538 is a reply to message #67483] |
Sun, 02 August 2009 19:31  |
b.a
Messages: 26 Registered: July 2009
|
Junior Member |
|
|
On Aug 1, 12:07 am, David Fanning <n...@dfanning.com> wrote:
> b.a writes:
>> In my program, there is a main widget which has "button1". each time
>> "button1" is pressed, a relevant file opens and according to the data
>> values in that file, a curve is plotted (actually Oplotted) on the
>> draw window. For each curve, there exists a "remove button". Now I
>> want to remove the relevant curve (plot) , whenever "remove button" is
>> clicked.
>
>> As far as I know if I use iplot, each time a curve is plotted, it
>> would be a new popup window.
>
> You haven't been here long enough to fully appreciate
> Coyote's sense of humor. (Sometimes he writes these
> articles while I'm playing tennis.) Ignore the iPlot
> suggestion. He was making a joke.
>
>> I don't know how to appear that window in
>> my GUI. and by the way I didn't understand "Draw the plot
>> over without that curve in it".
>
> Presumably you have a list of the things you have plotted
> in the window. (Maybe you made a pointer array or used
> a LinkedList or something, so you can re-draw them in
> the window, if needed.) To delete a plot, just remove
> it from that list and re-plot the rest of the items in
> the list. Or, maybe you have a flag of list indices, and
> you only plot the items in the list if the flag is set to
> 1. Something along those lines.
>
> 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.")
Yea, I am using Hashtable to keep track of the data and removing the
selected plot and replotting it, should serve the purpose. I will try
that.
By the way, it takes time to understand Coyote's sense of humor :)
Thanks a lot.
Afra
|
|
|
Re: oplot with colours [message #67558 is a reply to message #67483] |
Fri, 31 July 2009 07:07  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
b.a writes:
> In my program, there is a main widget which has "button1". each time
> "button1" is pressed, a relevant file opens and according to the data
> values in that file, a curve is plotted (actually Oplotted) on the
> draw window. For each curve, there exists a "remove button". Now I
> want to remove the relevant curve (plot) , whenever "remove button" is
> clicked.
>
> As far as I know if I use iplot, each time a curve is plotted, it
> would be a new popup window.
You haven't been here long enough to fully appreciate
Coyote's sense of humor. (Sometimes he writes these
articles while I'm playing tennis.) Ignore the iPlot
suggestion. He was making a joke.
> I don't know how to appear that window in
> my GUI. and by the way I didn't understand "Draw the plot
> over without that curve in it".
Presumably you have a list of the things you have plotted
in the window. (Maybe you made a pointer array or used
a LinkedList or something, so you can re-draw them in
the window, if needed.) To delete a plot, just remove
it from that list and re-plot the rest of the items in
the list. Or, maybe you have a flag of list indices, and
you only plot the items in the list if the flag is set to
1. Something along those lines.
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 #67568 is a reply to message #67483] |
Fri, 31 July 2009 00:13  |
b.a
Messages: 26 Registered: July 2009
|
Junior Member |
|
|
In my program, there is a main widget which has "button1". each time
"button1" is pressed, a relevant file opens and according to the data
values in that file, a curve is plotted (actually Oplotted) on the
draw window. For each curve, there exists a "remove button". Now I
want to remove the relevant curve (plot) , whenever "remove button" is
clicked.
As far as I know if I use iplot, each time a curve is plotted, it
would be a new popup window. I don't know how to appear that window in
my GUI. and by the way I didn't understand "Draw the plot
over without that curve in it".
Thank you
Afra
|
|
|
Re: oplot with colours [message #67569 is a reply to message #67483] |
Thu, 30 July 2009 23:37  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
b.a writes:
> 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.
I think maybe you should try iPlot. :-)
If you want to interact with a plot (click buttons,
for example) you are going to have to learn to write
widget programs. Do you know anything about that?
If you want a curve to disappear. Draw the plot
over without that curve in it. That's how it's
done.
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.")
|
|
|