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

Home » Public Forums » archive » Re: plot & oplot
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: plot & oplot [message #40688] Tue, 24 August 2004 01:16
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
Christopher Lee wrote:
> In article <cge3ri$kq6$1@agate.berkeley.edu>, "Marshall Perrin"
> <mperrin+news@cymric.berkeley.edu> wrote:
>
>
>
>> IDLmastertobe <shi_lee@hotmail.com> wrote:
>>
>>> If I was to plot a 1-d function, and wanted to do an oplot on the same
>>> window, how would I hide sections of the oplot that goes underneath the
>>> plot. I eventually want to do multiple oplots and hide sections that
>>> fall underneath the previous oplot. Please help.
>>
>> Just plot your functions from 'back' to 'front'. Each oplot will
>> overplot (hence the name!) everything that came before.
>> - Marshall
>
>
> Unless you want 'underneath' in the vertical axis sense, not the z-axis
> sense.
>
> You can use polyfill, with the background color, to block out anything
> under the line you plot.
>
> e.g
> ;some data
> x=findgen(101)
> y1=x
> y2=100-x
>
> plot, x,y1 ;the first data
> ;cover up everything underneath the second line
> polyfill, [x, reverse(x)], [y2, replicate(min(y2),n_elements(x))],color=0
> ;plot the second line
> oplot, x,y2
> ;replot the axis
> plot, x, y1,/nodata,/noer
> ;
>
> Chris

For simple plots, one could even try

plot,x,y1
oplot,x,y2>y1


Paolo
Re: plot & oplot [message #40689 is a reply to message #40688] Tue, 24 August 2004 00:52 Go to previous message
Chris Lee is currently offline  Chris Lee
Messages: 101
Registered: August 2003
Senior Member
In article <cge3ri$kq6$1@agate.berkeley.edu>, "Marshall Perrin"
<mperrin+news@cymric.berkeley.edu> wrote:


> IDLmastertobe <shi_lee@hotmail.com> wrote:
>> If I was to plot a 1-d function, and wanted to do an oplot on the same
>> window, how would I hide sections of the oplot that goes underneath the
>> plot. I eventually want to do multiple oplots and hide sections that
>> fall underneath the previous oplot. Please help.
> Just plot your functions from 'back' to 'front'. Each oplot will
> overplot (hence the name!) everything that came before.
> - Marshall

Unless you want 'underneath' in the vertical axis sense, not the z-axis
sense.

You can use polyfill, with the background color, to block out anything
under the line you plot.

e.g
;some data
x=findgen(101)
y1=x
y2=100-x

plot, x,y1 ;the first data
;cover up everything underneath the second line
polyfill, [x, reverse(x)], [y2, replicate(min(y2),n_elements(x))],color=0
;plot the second line
oplot, x,y2
;replot the axis
plot, x, y1,/nodata,/noer
;

Chris
Re: plot & oplot [message #40691 is a reply to message #40689] Mon, 23 August 2004 17:58 Go to previous message
mperrin+news is currently offline  mperrin+news
Messages: 81
Registered: May 2001
Member
IDLmastertobe <shi_lee@hotmail.com> wrote:
> If I was to plot a 1-d function, and wanted to do an oplot on the same
> window, how would I hide sections of the oplot that goes underneath the
> plot. I eventually want to do multiple oplots and hide sections that fall
> underneath the previous oplot. Please help.

Just plot your functions from 'back' to 'front'. Each oplot will
overplot (hence the name!) everything that came before.

- Marshall
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: plot & oplot
Next Topic: Re: returning filename suffix

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

Current Time: Wed Oct 08 19:48:12 PDT 2025

Total time taken to generate the page: 0.00557 seconds