Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: Color regions of plot background
Date: Fri, 2 May 2008 13:19:43 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 22
Message-ID: <fvf4df$rqp$1@canopus.cc.umanitoba.ca>
References: <fvf137$njj$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1209734383 28505 192.70.172.160 (2 May 2008 13:19:43 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Fri, 2 May 2008 13:19:43 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:466271



In article <fvf137$njj$1@fred.mathworks.com>,
David Doria <daviddoria@gmail.com> wrote:
>Is there a ways to set the color of the plot background over
>particular intervals

>say i want the background on [0,1] red and [1,2] blue

>is this possible?

No. There is only one plot background color.

What you can do, though, is create patch() objects in the areas you
want, and set the patch FaceColor to the color you want, and
set the patch EdgeColor to 'none'. You might have to play
with the patch alpha transparency parameters or the z coordinate of
the patch to get the plot lines to appear "above" the background
colors.
-- 
  "Ignorance has been our king... he sits unchallenged on the throne of
  Man. His dynasty is age-old. His right to rule is now considered
  legitimate. Past sages have affirmed it. They did nothing to unseat
  him."                                       -- Walter M Miller, Jr