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

Home » Public Forums » archive » Re: Multiple plots in one figure
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: Multiple plots in one figure [message #68309 is a reply to message #68306] Mon, 12 October 2009 05:43 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Nicki writes:

> Seriously, i am so lost, since i do not even know what keywords I have
> to look up in order find a solution for this problem... I mean the
> multiple plots in one figure are not the problem, the problem is to
> find the EASIEST way to solve this...(however i don't really know HOW
> to do the multiple plotting for this case, either)
> if i start saying (note that a[0] should belong to m[0] and a[1] to b
> [1] and so on, so that I end up with 3(!!) plots)
>
> x=findgen(10)
> m=[1,5,10]
> a=[1,4,2]
>
> y=m[i]*x+a[i]
>
> if i eq 0 then plot,x,y
> else oplot,x,y
>
>
> whaaaa, i don't know it... this does not work...

Well, it is hard to know if you are typing *actual*
code or pseudo code. But this works:

x=findgen(10)
m=[1,5,10]
a=[1,4,2]

for j=0,2 do begin
if j eq 0 $
then plot, x, m[j]*x+a[j] $
else oplot, x, m[j]*x+a[j], linestyle=j
endfor
end


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.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Browse for Cloud-Free MODIS Images
Next Topic: Re: Browse for Cloud-Free MODIS Images

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

Current Time: Wed Oct 08 19:26:58 PDT 2025

Total time taken to generate the page: 0.00397 seconds