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

Home » Public Forums » archive » Re: The plot including another plot
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: The plot including another plot [message #47355] Tue, 07 February 2006 06:00 Go to next message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
YJP wrote:
> HI~ ALL ^^
>
> I want to plot a graph which include another graph.
> Actually, I want to plot a samll part of main graph on
> the marginal region. The small one is just enlarged
> version of the some part of main graph.
>
>
> like this~
> -------------------------------------
> - ----------- -
> - y - - -
> y - - - -
> - ----------- -
> - x -
> - -
> -------------------------------------
> x
>
> Is there any procedure doing this job?
> Otherwise, How do I approch it?
>
> Thank you~^^
>
> Best Wishes, ***
>

Here's an example that works even with !P.Multi NE 0,
slightly modified from the original code which produced
the figure:

http://www.astro.phys.ethz.ch/staff/pgrigis/private/2265fig1 .eps


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

xrange=[0,10]
yrange=[0,10]

N=200
x=findgen(N)/(N-1)*10
y=0.3*exp(x)


plot,x,y,xrange=xrange,yrange=yrange,psym=-4


zoomxrange=[2,3];coordinates of zoom region
zoomyrange=[3,4]

plotxcoord=[5,9];region of the plot where to place the zoomed plot
plotycoord=[5,9];in data coordinates

oplot,zoomxrange[[0,1,1,0,0]],zoomyrange[[0,0,1,1,0]]

zoomcoord=convert_coord(zoomxrange,zoomyrange,/data,/to_norm al)
plotcoord=convert_coord(plotxcoord,plotycoord,/data,/to_norm al)

oplot,[zoomxrange[1],plotxcoord[0]],[zoomyrange[0],plotycoor d[0]],linestyle=1
oplot,[zoomxrange[1],plotxcoord[0]],[zoomyrange[1],plotycoor d[1]],linestyle=1

plot,x,y,xrange=zoomxrange,/xstyle $
,yrange=zoomyrange,/ystyle $
,position=plotcoord[[0,1,3,4]],charsize=0.8 $
,/noerase,yticks=2,ytickv=[3,3.5,4] $
,xticks=2,xtickv=[2.,2.5,3.],xmargin=[0.,0],ymargin=[0.,0],p sym=-4


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;


Ciao,
Paolo
Re: The plot including another plot [message #47356 is a reply to message #47355] Tue, 07 February 2006 05:47 Go to previous messageGo to next message
snfinder@naver.com is currently offline  snfinder@naver.com
Messages: 35
Registered: August 2005
Member
HA HA ^^

Thanks Peter~

It's very easy. ^^



I really like this news group. ^^
It always give me a big help!!!
Re: The plot including another plot [message #47357 is a reply to message #47356] Tue, 07 February 2006 05:30 Go to previous messageGo to next message
peter.albert@gmx.de is currently offline  peter.albert@gmx.de
Messages: 108
Registered: July 2005
Senior Member
Hi YJP,

you want to use the POSITION and NOERASE keywords like

PLOT, xxx, yyy
PLOT, xxx[100:200], yyy[100:200], $
/NOERASE,
/POSITION=[.1, .7, .3, .9]

Just play around with the position numbers to place the small plot
where you want to have it.

Cheers,

Peter
Re: The plot including another plot [message #47437 is a reply to message #47355] Tue, 07 February 2006 18:01 Go to previous message
snfinder@naver.com is currently offline  snfinder@naver.com
Messages: 35
Registered: August 2005
Member
Wow~ Thanks Paolo~!
That's exactly what I want!!!

A sample figure is very good.

GL,
YJP
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Colorbar with Color levels different than ticklevels
Next Topic: MPFITFUN, constraining parameters

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

Current Time: Wed Oct 08 19:05:51 PDT 2025

Total time taken to generate the page: 0.00519 seconds