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

Home » Public Forums » archive » Re: Extension to "Overplotting Data on !P.MULTI 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: Extension to "Overplotting Data on !P.MULTI Plots" [message #35723] Fri, 11 July 2003 09:45 Go to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
raphael schefold wrote:
> After overplotting data on !P.MULTI Plots it is sometimes necessary to
> plot the axis, titles etc again to have the axis (which is mostly
> black) drawn over your data lines (which are often colored).
> But plot, data, /noerase, /nodata jumps to the next plot window. For
> that,
> !p.multi(0)=!p.multi(0)+1 helps, as you can see in the following code.
>
> I am posting, because I met several people who were confused about
> that.
>
> -Raphael

Dear Raphael

it's better to use first the plot routine with /nodata.
Because then the coordination system is defined.
And the axis are drawn whithout the data.

At this point you can now use additional routines like polyfill to
mark regions of the plotarea. Then all following plots have to be done
by oplot. So they are automaticly in the forground of areas.

At least in some cases it could be necessary to draw at the end the axis
again. I do this by the axis command.
One of the cases is the oplot could overplot the tickmarks.


We have developed over several years a library to get mostly very good
outputs on screen, postscript and animations.

If you are interested you should have a look at our library
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html

escpecially at the examples
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/idl_work_idl_work.examples.category.htm#2


And here is a short example of source:

An actual version of plotprepare you can find here:

wget
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _bin/plotprepare.sav

This routine sav file is builded from all dependencies of the plot library.

pro plot_20030711
x=findgen(10) & y=sin(x)
plotprepare,plot,dim=1
plot.rows=2 & plot.columns=2
;plot.psflag=1
plot.page_title='TEST for IDL-PVWAVE'
; xp_layout,plot
plotinit,plot
plot.psym=0
plot.xtitle='X' &plot.ytitle='Y'
plot.yrange=[0,1]
set_frame,plot,x=x,y=y,type='XY'
yv=plot.yrange & xv=[0.2,1.5]
POLYFILL,[xv[0],xv[1],xv[1],xv[0]],[yv[0],yv[0],yv[1],yv[1]] ,$
/data,color=plot.color_nc.orange ,/fill

plot.color=plot.color_nc.medium_grey
plotxy,plot,x=x,y=y
plot.new=1 & plot.color=plot.color_nc.red
plotxy,plot,x=x,y=y
plot.new=1 & plot.color=plot.color_nc.blue
plotxy,plot,x=x,y=y
plot.new=1 & plot.color=plot.color_nc.green
plotxy,plot,x=x,y=y
plotend,plot
end

The result of this looks similiar to this
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _bin/20030711/plot_20030711.png


best

regards
Reimar

--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======



>
> Example code for "nodata noerase plot after overplotting Data on
> !P.MULTI Plots":
>
> !P.MULTI= [0, 2, 2]
>
> p_sav=replicate(!p, 4)
> x_sav=replicate(!x, 4)
> y_sav=replicate(!y, 4)
>
> for i=0, 3 do begin
> plot, [0,1], [0, 1], title=string(i), /nodata
> p_sav(i)=!p & x_sav(i)=!x & y_sav(i)=!y
> end
>
> for i=0, 3 do begin
> !p=p_sav(i) & !x=x_sav(i) & !y=y_sav(i)
> oplot, [.5], [.5], psym=i
> end
>
> for i=0, 3 do begin
> !p=p_sav(i) & !x=x_sav(i) & !y=y_sav(i)
> !p.multi(0)=!p.multi(0)+1
> plot, [0,1], [0, 1], title=string(i), /nodata, /noerase
> end
Re: Extension to "Overplotting Data on !P.MULTI Plots" [message #35726 is a reply to message #35723] Fri, 11 July 2003 05:40 Go to previous messageGo to next message
wmconnolley is currently offline  wmconnolley
Messages: 106
Registered: November 2000
Senior Member
raphael schefold <raphael.schefold@gmx.ch> wrote:
> After overplotting data on !P.MULTI Plots it is sometimes necessary to
> plot the axis, titles etc again to have the axis (which is mostly
> black) drawn over your data lines (which are often colored).
> But plot, data, /noerase, /nodata jumps to the next plot window. For
> that,
> !p.multi(0)=!p.multi(0)+1 helps, as you can see in the following code.

Use the axis command.

-W.

--
William M Connolley | wmc@bas.ac.uk | http://www.antarctica.ac.uk/met/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
I'm a .signature virus! copy me into your .signature file & help me spread!
Re: Extension to "Overplotting Data on !P.MULTI Plots" [message #35814 is a reply to message #35726] Mon, 14 July 2003 09:46 Go to previous message
raphael.schefold is currently offline  raphael.schefold
Messages: 2
Registered: July 2003
Junior Member
wmc@bas.ac.uk wrote in message news:<3f0eb04c@news.nwl.ac.uk>...
> raphael schefold <raphael.schefold@gmx.ch> wrote:
>> After overplotting data on !P.MULTI Plots it is sometimes necessary to
>> plot the axis, titles etc again to have the axis (which is mostly
>> black) drawn over your data lines (which are often colored).
>> But plot, data, /noerase, /nodata jumps to the next plot window. For
>> that,
>> !p.multi(0)=!p.multi(0)+1 helps, as you can see in the following code.
>
> Use the axis command.
>
Is there any particular reason to use the axis command? I can restore
easily all graphical system variables and plot all necessary axes with
plot, ..., /nodata, /noerase.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL Virtual Machine information
Next Topic: Newbie Widget table question

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

Current Time: Thu Oct 09 06:03:26 PDT 2025

Total time taken to generate the page: 0.01182 seconds