Re: overlaying two plots [message #69597] |
Fri, 05 February 2010 08:57 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> I learned a long time ago it is best to ignore ill-formed
> questions. You do all this guessing and work, and you
> (usually) never hear from the guy again. People who can't
> form questions, usually can't solve problems, and leave
> programming pretty early in the game. :-)
I should probably mention that I always give the benefit
of the doubt to people when it looks like English is not
their native language. It is difficult to distinguish
between non-native speakers and teenagers, but I try.
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: overlaying two plots [message #69598 is a reply to message #69597] |
Fri, 05 February 2010 08:51  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Gianguido Cianci writes:
> Some feedback would be nice... Have you solved your problem? Are we
> missing the point?
I learned a long time ago it is best to ignore ill-formed
questions. You do all this guessing and work, and you
(usually) never hear from the guy again. People who can't
form questions, usually can't solve problems, and leave
programming pretty early in the game. :-)
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: overlaying two plots [message #69601 is a reply to message #69598] |
Fri, 05 February 2010 08:42  |
cgguido
Messages: 195 Registered: August 2005
|
Senior Member |
|
|
On Feb 3, 7:11 pm, "Mr.G" <gameplay...@gmail.com> wrote:
> What I want is the figure has two axis:
Some feedback would be nice... Have you solved your problem? Are we
missing the point?
Thanks,
G
|
|
|
Re: overlaying two plots [message #69605 is a reply to message #69601] |
Fri, 05 February 2010 08:02  |
MarioIncandenza
Messages: 231 Registered: February 2005
|
Senior Member |
|
|
On Feb 3, 5:11 pm, "Mr.G" <gameplay...@gmail.com> wrote:
> What I want is the figure has two axis:
> axis, xaxis=1,range=[0,50]
> then, oplot, x,y "as if the range determined by p q changed to [0,50]"
AXIS has a /SAVE keyword. I think that's what you want.
|
|
|
Re: overlaying two plots [message #69609 is a reply to message #69605] |
Thu, 04 February 2010 16:40  |
munka
Messages: 36 Registered: December 2009
|
Member |
|
|
On Feb 3, 7:11 pm, "Mr.G" <gameplay...@gmail.com> wrote:
> Dear All,
>
> Say I have two set of data:
>
> (1)
> x=findgen(101)*0.5
> y=sin(x)
>
> (2)
> p=findgen(501)*2
> q=exp(-p/500)
>
> Now, I want to overlay
> "plot,x,y"
> and
> "plot,p,q"
> on the same plot.
>
> I can not use oplot, since if I:
> "plot,p,q
> oplot,x,y"
> I will get very funny plots.
>
> What I want is the figure has two axis:
> axis, xaxis=1,range=[0,50]
> then, oplot, x,y "as if the range determined by p q changed to [0,50]"
>
> Is that possible in IDL?
>
> G
You could try doing
plot,p,q
plot,x,y,/noerase,ystyle=8,xstyle=8
The noerase keyword should simply plot one on top of the other... I
think the y/xstyle you want (it should not re-plot the axes). There
is a way to get the y-axis lable on the right side. Look up some
graphics keywords for plot.
|
|
|
Re: overlaying two plots [message #69611 is a reply to message #69609] |
Thu, 04 February 2010 10:54  |
cgguido
Messages: 195 Registered: August 2005
|
Senior Member |
|
|
> Is this what you mean?
>
> plot, p,q, xs=8, yr=[-1,1], color=fsc_color('green')
> oplot, x/50*1000, y, color=fsc_color('blue')
> axis, /noerase, /xaxis, xrange=[0,50], color=fsc_color('blue')
>
> -Gianguido
Btw, get fsc_color.pro and other excellent stuff at http://dfanning.com/
!
-Gianguido
|
|
|
Re: overlaying two plots [message #69675 is a reply to message #69611] |
Wed, 03 February 2010 18:26  |
cgguido
Messages: 195 Registered: August 2005
|
Senior Member |
|
|
On Feb 3, 7:11 pm, "Mr.G" <gameplay...@gmail.com> wrote:
> Dear All,
>
> Say I have two set of data:
>
> (1)
> x=findgen(101)*0.5
> y=sin(x)
>
> (2)
> p=findgen(501)*2
> q=exp(-p/500)
>
> Now, I want to overlay
> "plot,x,y"
> and
> "plot,p,q"
> on the same plot.
>
> I can not use oplot, since if I:
> "plot,p,q
> oplot,x,y"
> I will get very funny plots.
>
> What I want is the figure has two axis:
> axis, xaxis=1,range=[0,50]
> then, oplot, x,y "as if the range determined by p q changed to [0,50]"
>
> Is that possible in IDL?
>
> G
Is this what you mean?
plot, p,q, xs=8, yr=[-1,1], color=fsc_color('green')
oplot, x/50*1000, y, color=fsc_color('blue')
axis, /noerase, /xaxis, xrange=[0,50], color=fsc_color('blue')
-Gianguido
|
|
|