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

Home » Public Forums » archive » Re: overplotting with a new axis
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: overplotting with a new axis [message #11272] Tue, 17 March 1998 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
David Mottershead (DMottershead@mhl.nsw.gov.au) writes:

> Is there a way to overplot two lots of data using two different x-axes.

To modify the code just slightly from page 31 in my book:

curve1 = LoadData(1)
curve2 = Findgen(50)
curve2 = Sin(curve2/5)/Exp(curve2/50) * 15 + 15
Plot, curve1, XStyle=8, XTitle='Solid Line Axis', $
Position=[0.1, 0.15, 0.95, 0.9]
Axis, XAxis=1, XRange=[0,50], /Save, XTitle='Dashed Line Axis'
OPlot, curve2, LineStyle=2

The key is the SAVE keyword on the AXIS command. You want
to make sure that when you OPLOT the second curve that you
use the scaling parameters from the correct axis.

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Call_External problem under win95
Next Topic: overplotting with a new axis

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

Current Time: Wed Oct 08 18:07:14 PDT 2025

Total time taken to generate the page: 0.00597 seconds