i have some lines drawn on axes using the standard 'plot'
function. now i want to use 'patch' to overlay a
transparent shading _over_ the lines at a certain point such
that it shades (and somewhat obscures) the lines underneath.
here is what i have tried so far:
while this works to shade the axes, it is not actually
showing up as an overlay of the plotted lines. what i am
expecting here is that the patch will 'dim' the plotted
lines in the range [0.5 : 1]. any hints on how i might be
able to accomplish this?
"Bryan " <cssmwbs@gmail.com> wrote in message
<fvafa9$a2t$1@fred.mathworks.com>...
> hi all,
>
> i have some lines drawn on axes using the standard 'plot'
> function. now i want to use 'patch' to overlay a
> transparent shading _over_ the lines at a certain point such
> that it shades (and somewhat obscures) the lines underneath.
> here is what i have tried so far:
>
> figure, plot(rand(10));
> verts1 = [1 .5; 10 .5; 10 1; 1 1];
> faces1 = [1 2 3 4];
> patch('faces',faces1,'vertices',verts1,'edgecolor','none',...
> 'facecolor',[.65 .65 .65],'facealpha',.25)
>
> while this works to shade the axes, it is not actually
> showing up as an overlay of the plotted lines. what i am
> expecting here is that the patch will 'dim' the plotted
> lines in the range [0.5 : 1]. any hints on how i might be
> able to accomplish this?
>
> thanks in advance,
> bryan
It can't be done by the method you're describing because
using transparency requires the open gl renderer, which
ALWAYS draws lines on top of patches, (which annoys me to no
end) so you can't put a line behind a patch. You might be
able to fake it by drawing a new set of lines just in the
patch area that are a different color (a mix of their
original color and the patch color) but if the data points
don't line up with the edges of your patch that might be
pretty tricky.
In article <fvafa9$a2t$1@fred.mathworks.com>, Bryan <cssmwbs@gmail.com> wrote:
>i have some lines drawn on axes using the standard 'plot'
>function. now i want to use 'patch' to overlay a
>transparent shading _over_ the lines at a certain point such
>that it shades (and somewhat obscures) the lines underneath.
> here is what i have tried so far:
>while this works to shade the axes, it is not actually
>showing up as an overlay of the plotted lines. what i am
>expecting here is that the patch will 'dim' the plotted
>lines in the range [0.5 : 1]. any hints on how i might be
>able to accomplish this?
Use a brighter facecolor. For example if you change the facecolor to
[1 1 1] then you can see clearly that the lines are dimmed underneath
the patch.
--
"Not the fruit of experience, but experience itself, is the end."
-- Walter Pater
"matt dash" <n.a@mail.com> wrote in message
<fvah0j$mdb$1@fred.mathworks.com>...
> I still get nothing... (as evidenced by my post above)... I
> wonder if it's a matlab version or graphics hardware issue....
>
yeah, sorry... i meant to mention i have tried a bunch of
colors, nothing works to obscure the lines. i have also
tried software opengl rendering in case hardware rendering
drivers were the issue, still not working.
i run matlab 2007b on a linux64 system with a GeForce 8800
GT/PCI/SSE2 video card. and you guys?
In article <fvaij6$s22$1@fred.mathworks.com>, Bryan <cssmwbs@gmail.com> wrote:
>yeah, sorry... i meant to mention i have tried a bunch of
>colors, nothing works to obscure the lines.
It does for me, especially as I increase the facealpha.
> i have also
>tried software opengl rendering in case hardware rendering
>drivers were the issue, still not working.
>i run matlab 2007b on a linux64 system with a GeForce 8800
>GT/PCI/SSE2 video card. and you guys?
2007a running off a linux64 system, displayed via X to an
SGI Indigo^2 Impact (from about 1995.)
--
"It's a hard life sometimes and the biggest temptation is to let
how hard it is be an excuse to weaken." -- Walter Dean Myers
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.