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

Home » Public Forums » archive » Re: overlaying two plots
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: overlaying two plots [message #69597] Fri, 05 February 2010 08:57
David Fanning is currently offline  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 Go to previous message
David Fanning is currently offline  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 Go to previous message
cgguido is currently offline  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 Go to previous message
MarioIncandenza is currently offline  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 Go to previous message
munka is currently offline  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 Go to previous message
cgguido is currently offline  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 Go to previous message
cgguido is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL without X11?
Next Topic: Using XYOUTS to substitute numbers for symbols on scatter plots: a caveat

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

Current Time: Wed Oct 08 20:06:08 PDT 2025

Total time taken to generate the page: 0.38707 seconds