PDA

View Full Version : Plot with Shaded Regions?



hcrisp
03-25-2009, 11:52 AM
How can I create a plot with shaded regions to indicate regions of interest? What I am looking for is something like this:

http://www.mathworks.com/matlabcentral/fx_files/3550/1/ShadePlotForEmphasis.jpg

Any ideas?

hcrisp
03-25-2009, 01:01 PM
Found one method using POLYFILL. Seems to work okay.



x = SIN(FINDGEN(500)/100.*2.*!PI)
PLOT, x
POLYFILL, [200.,200.,300.,300.], [-1., 1.,1.,-1.], COL=47
OPLOT, x

rwagner
03-25-2009, 02:27 PM
yeah, polyfill's your only choice for shading... it works really well though.