From: Judy on
Hello all,

How do you go about coloring the space between two parallel lines on a plot?

Fill() seems to be for closed shapes.. so that's no good. The line properties seems too complicated since I would need to somehow relate the width between my two lines with "points".

Thanks!
From: someone on
"Judy " <sauwen.jl(a)gmail.com> wrote in message <i37qq9$srd$1(a)fred.mathworks.com>...
> Hello all,
>
> How do you go about coloring the space between two parallel lines on a plot?
>
> Fill() seems to be for closed shapes.. so that's no good. The line properties seems too complicated since I would need to somehow relate the width between my two lines with "points".
>
> Thanks!

doc area

% Look in the Examples section.
From: us on
"Judy " <sauwen.jl(a)gmail.com> wrote in message <i37qq9$srd$1(a)fred.mathworks.com>...
> Hello all,
>
> How do you go about coloring the space between two parallel lines on a plot?
>
> Fill() seems to be for closed shapes.. so that's no good. The line properties seems too complicated since I would need to somehow relate the width between my two lines with "points".
>
> Thanks!

a hint:

help patch;

us
From: Judy on
I looked at patch but when I wanted to color in two vertical lines, it made 2 triangles instead. I suppose I could indicate 4 vertices.. but that doesn't seem very clean.

I saw an area function as well, and it works well. I changed my two parallel lines to just an array, going from 0 to 1 and then back down from 1 to 0 when ready.

Only thing now, is the coloring option doesn't seem to be working.

Here is an example.

Why isn't my filled color changing to cyan?

a=zeros(1,10); a(6:7)=5;
figure,
plot(a);
area(a,'FaceColor','c')

Thanks!
From: Judy on
Whoops... I meant 4 vertices as more points to make up 4 total triangles.... :P
 |  Next  |  Last
Pages: 1 2 3 4
Prev: Periodogram PSD of a white noise
Next: executable files