|
Walter Linzenbold wrote:
> Is there a way to set the background color of a plot to
> multiple colors?
No.
> For example:
>
> x = (-10:10)
> y = ones(size(x));
> plot(x,y)
> In this case I want the background to be green for x-axis
> -10 to 0 and red for x-axis 0 to 10.
patch() or rectangle() the area first and then draw on top of it.
Warning: somewhere or other (I couldn't find it again when I last looked)
there is a note that when opengl is used as the renderer, and
if you draw patches and lines in the same 2D plane (e.g., because you
did not provide any z coordinate for the patches) then instead of
being rendered in normal child order, that the patch will always appear
"below" the line. This problem has come up in practice to posters a
couple of times this year -- they wanted the patch to overlay the line
(with alpha transparency leaving the line partly visible) and they
couldn't do it. They may have been using PC systems. When I tested
on my linux-64 system, the patch was on top of the line, the opposite
of the documented situation. Thus, possibly depending on your OS and
exact graphics card, if you need to use alpha transparency (and so
need to use opengl as the renderer) then you might find that you need
to specify explicit z coordinates for the patch, just "above" or just
"below" your lines [according to what you are trying to achieve.]
--
Q = quotation(rand);
if isempty(Q); error('Quotation server filesystem problems')
else sprintf('%s',Q), end
|