<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/214694</link>
    <title>MATLAB Central Newsreader - multiple background-color</title>
    <description>Feed for thread: multiple background-color</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 18 Aug 2008 11:45:08 -0400</pubDate>
      <title>multiple background-color</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/214694#575390</link>
      <author>Walter Linzenbold</author>
      <description>Hi.&lt;br&gt;
&lt;br&gt;
Is there a way to set the background color of a plot to&lt;br&gt;
multiple colors?&lt;br&gt;
&lt;br&gt;
For example:&lt;br&gt;
&lt;br&gt;
x = (-10:10)&lt;br&gt;
y = ones(size(x));&lt;br&gt;
&lt;br&gt;
plot(x,y)&lt;br&gt;
&lt;br&gt;
In this case I want the background to be green for x-axis&lt;br&gt;
-10 to 0 and red for x-axis 0 to 10.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Thx and regards.&lt;br&gt;
Walter</description>
    </item>
    <item>
      <pubDate>Mon, 18 Aug 2008 16:40:04 -0400</pubDate>
      <title>Re: multiple background-color</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/214694#575458</link>
      <author>Walter Roberson</author>
      <description>Walter Linzenbold wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; Is there a way to set the background color of a plot to&lt;br&gt;
&amp;gt; multiple colors?&lt;br&gt;
&lt;br&gt;
No.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;gt; For example:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; x = (-10:10)&lt;br&gt;
&amp;gt; y = ones(size(x));&lt;br&gt;
&lt;br&gt;
&amp;gt; plot(x,y)&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;gt; In this case I want the background to be green for x-axis&lt;br&gt;
&amp;gt; -10 to 0 and red for x-axis 0 to 10.&lt;br&gt;
&lt;br&gt;
patch() or rectangle() the area first and then draw on top of it.&lt;br&gt;
&lt;br&gt;
Warning: somewhere or other (I couldn't find it again when I last looked)&lt;br&gt;
there is a note that when opengl is used as the renderer, and&lt;br&gt;
if you draw patches and lines in the same 2D plane (e.g., because you&lt;br&gt;
did not provide any z coordinate for the patches) then instead of&lt;br&gt;
being rendered in normal child order, that the patch will always appear&lt;br&gt;
&quot;below&quot; the line. This problem has come up in practice to posters a&lt;br&gt;
couple of times this year -- they wanted the patch to overlay the line&lt;br&gt;
(with alpha transparency leaving the line partly visible) and they&lt;br&gt;
couldn't do it. They may have been using PC systems. When I tested&lt;br&gt;
on my linux-64 system, the patch was on top of the line, the opposite&lt;br&gt;
of the documented situation. Thus, possibly depending on your OS and&lt;br&gt;
exact graphics card, if you need to use alpha transparency (and so&lt;br&gt;
need to use opengl as the renderer) then you might find that you need&lt;br&gt;
to specify explicit z coordinates for the patch, just &quot;above&quot; or just&lt;br&gt;
&quot;below&quot; your lines [according to what you are trying to achieve.]&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Q = quotation(rand);&lt;br&gt;
if isempty(Q); error('Quotation server filesystem problems')&lt;br&gt;
else sprintf('%s',Q), end</description>
    </item>
    <item>
      <pubDate>Tue, 19 Aug 2008 03:47:43 -0400</pubDate>
      <title>Re: multiple background-color</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/214694#575537</link>
      <author>ControlTheoryPro@gmail.com</author>
      <description>I haven't used it in a long time but I remember the &quot;area&quot; function&lt;br&gt;
begin good for that.  I'd study the help.&lt;br&gt;
&lt;br&gt;
Gabe&lt;br&gt;
Wiki category on all sorts of MATLAB stuff - still growing&lt;br&gt;
&lt;a href=&quot;http://wikis.controltheorypro.com/index.php?title=Category:MATLAB&quot;&gt;http://wikis.controltheorypro.com/index.php?title=Category:MATLAB&lt;/a&gt;</description>
    </item>
  </channel>
</rss>

