Prev: Periodogram PSD of a white noise
Next: executable files
From: Judy on 2 Aug 2010 21:19 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 2 Aug 2010 23:08 "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 3 Aug 2010 01:56 "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 3 Aug 2010 20:29 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 3 Aug 2010 20:45
Whoops... I meant 4 vertices as more points to make up 4 total triangles.... :P |