conditional plot [message #87692] |
Sun, 23 February 2014 12:52  |
Nims
Messages: 8 Registered: February 2014
|
Junior Member |
|
|
Hello everyone
I want to do a conditional overplot like
if a eq 'A' and b eq 'B' then not oplot,x,y
I mean that if the two conditions are satisfied then don't do the overplot. How can I do this? Could someone please help me?
Thank you in advance
|
|
|
Re: conditional plot [message #87695 is a reply to message #87692] |
Sun, 23 February 2014 15:14   |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
On Sunday, February 23, 2014 1:52:24 PM UTC-7, Nims wrote:
> Hello everyone
>
> I want to do a conditional overplot like
>
>
>
> if a eq 'A' and b eq 'B' then not oplot,x,y
>
>
>
> I mean that if the two conditions are satisfied then don't do the overplot. How can I do this? Could someone please help me?
>
>
>
> Thank you in advance
Well, I can think of at least 2 ways:
; Reverse the logic!
if (a ne 'A' || b ne 'B') then oplot,x,y
; Dorky, but keeps the logic
if (a eq 'A' && b eq 'B') then begin
endif else begin
oplot,x,y
endelse
-Chris
|
|
|
Re: conditional plot [message #87697 is a reply to message #87692] |
Sun, 23 February 2014 15:51  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Nims writes:
> I want to do a conditional overplot like
>
> if a eq 'A' and b eq 'B' then not oplot,x,y
>
> I mean that if the two conditions are satisfied then don't do the overplot. How can I do this? Could someone please help me?
IF (a NE 'A') OR (b NE 'B') THEN OPlot, x, y
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|