Re: how to shade region of 2-D plot [message #13657 is a reply to message #13533] |
Fri, 20 November 1998 00:00   |
Martin Schultz
Messages: 515 Registered: August 1997
|
Senior Member |
|
|
Stein Vidar Hagfors Haugan wrote:
> In article <MPG.10bde9e8e981acc0989688@news.frii.com>
> davidf@dfanning.com (David Fanning) writes:
>
>> Joseph Scott Stuart (nospam@ll.mit.edu) writes:
>>
>>> Is there a relatively painless way to shade a region on a 2-D plot?
>>> Baically, I have a computed function that I want to plot with error
>>> bars, and I'd like to plot the error bars as a shaded region around
>>> the plotted nominal value. I could just plot error bars with the
>>> points and play around with spacing between the points and the line
>>> thickness of the error bars until it sort of looks like a shaded
>>> region, but is there a nicer way to do it?
>
[...]
>
> How about
>
... one minor change ...
>
> y=20*cos(findgen(50)/3)
> plot,y,ystyle=2 , /NODATA ; <<<<<<<<<<<<<<<<<<<<<<<
> bot=y-1.0
> top=y+1.0
> polyfill,[findgen(50),reverse(findgen(50))],[bot,reverse(top )],/data
> oplot,y,color=0
>
> or something? Seems simple enough for me.
>
> Regards,
>
> Stein Vidar
Martin
--
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Engineering&Applied Sciences, Harvard University
109 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA
phone: (617)-496-8318
fax : (617)-495-4551
e-mail: mgs@io.harvard.edu
Internet-homepage: http://www-as.harvard.edu/people/staff/mgs/
------------------------------------------------------------ -------
|
|
|