From: Judy on
"us " <us(a)neurol.unizh.ch> wrote in message <i3cdh8$f58$1(a)fred.mathworks.com>...
> "Judy " <sauwen.jl(a)gmail.com> wrote in message <i3ac8p$qvl$1(a)fred.mathworks.com>...
> > 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.
>
> this reflects a false setup of your X/Y parameters for PATCH...
> can you show CSSM how you called the function(?)...
> note: PATCH is much more versatile compared to AREA, which comes with a simple level arg to close your patch...
>
> us

figure,
line([1 1],[0 10]);
line([5,5],[0,10]);
hold on,
plot(0:6, zeros(1,7)); %reference to make plot zoom out a bit
% xData=[1; 5; 1; 5]
% yData=[0; 0; 10; 10]
xData=[1; 1; 5; 5]
yData=[0; 10; 0; 10]
zData=zeros(4,1);
patch(xData,yData,zData,'c')

Here's how my output looks: http://drop.io/rsac8vu1711

Thanks~
From: us on
"Judy " <sauwen.jl(a)gmail.com> wrote in message <i3ceu8$fin$1(a)fred.mathworks.com>...
> "us " <us(a)neurol.unizh.ch> wrote in message <i3cdh8$f58$1(a)fred.mathworks.com>...
> > "Judy " <sauwen.jl(a)gmail.com> wrote in message <i3ac8p$qvl$1(a)fred.mathworks.com>...
> > > 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.
> >
> > this reflects a false setup of your X/Y parameters for PATCH...
> > can you show CSSM how you called the function(?)...
> > note: PATCH is much more versatile compared to AREA, which comes with a simple level arg to close your patch...
> >
> > us
>
> figure,
> line([1 1],[0 10]);
> line([5,5],[0,10]);
> hold on,
> plot(0:6, zeros(1,7)); %reference to make plot zoom out a bit
> % xData=[1; 5; 1; 5]
> % yData=[0; 0; 10; 10]
> xData=[1; 1; 5; 5]
> yData=[0; 10; 0; 10]
> zData=zeros(4,1);
> patch(xData,yData,zData,'c')
>
> Here's how my output looks: http://drop.io/rsac8vu1711
>
> Thanks~

what CSSMers thought: false arrangement of X/Y data...

one of the solutions

x=[1,5,5,1];
y=[0,0,10,10];
patch(x,y,[0,1,1]);
set(gca,'xlim',[0,6],'ylim',[-1,11]);

us
From: us on
On Aug 4, 9:42 pm, "us " <u...(a)neurol.unizh.ch> wrote:
> "Judy " <sauwen...(a)gmail.com> wrote in message <i3ceu8$fi...(a)fred.mathworks.com>...
> > "us " <u...(a)neurol.unizh.ch> wrote in message <i3cdh8$f5...(a)fred.mathworks.com>...
> > > "Judy " <sauwen...(a)gmail.com> wrote in message <i3ac8p$qv...(a)fred.mathworks.com>...
> > > > 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.
>
> > > this reflects a false setup of your X/Y parameters for PATCH...
> > > can you show CSSM how you called the function(?)...
> > > note: PATCH is much more versatile compared to AREA, which comes with a simple level arg to close your patch...
>
> > > us
>
> > figure,
> > line([1 1],[0 10]);
> > line([5,5],[0,10]);
> > hold on,
> > plot(0:6, zeros(1,7)); %reference to make plot zoom out a bit
> > % xData=[1; 5; 1; 5]
> > % yData=[0; 0; 10; 10]
> > xData=[1; 1; 5; 5]
> > yData=[0; 10; 0; 10]
> > zData=zeros(4,1);
> > patch(xData,yData,zData,'c')
>
> > Here's how my output looks:http://drop.io/rsac8vu1711
>
> > Thanks~
>
> what CSSMers thought: false arrangement of X/Y data...
>
> one of the solutions
>
>      x=[1,5,5,1];
>      y=[0,0,10,10];
>      patch(x,y,[0,1,1]);
>      set(gca,'xlim',[0,6],'ylim',[-1,11]);
>
> us- Hide quoted text -
>
> - Show quoted text -

and here's an example to show the versatility of PATCH...

x=1:10;
ybot=rand(size(x));
ytop=rand(size(x))+2;
xp=[x,x(end:-1:1)]; % <- closed area...
yp=[ybot,ytop(end:-1:1)];
patch(xp,yp,[0,1,1]);
set(gca,'xlim',[0,11],'ylim',[-1,4]);

us
From: Judy on
Grah.. I see what I did. It works, thanks!
From: Walter Roberson on
Judy wrote:
> Walter Roberson <roberson(a)hushmail.com> wrote in message
> <i3cc6p$cbf$1(a)canopus.cc.umanitoba.ca>...
>> Judy wrote:
>> > Looks like MATLAB thinks it is filling in the right color but it
>> isn't > being displayed as so. I've tried other colors too in the
>> FaceColor > property and it still results in a filled in dark blue
>> color as seen in > my link below. I may just have to live with this
>> if there is no other > choice.
>>
>> What is your renderer set to?
>
> What is a rendered set? (?) Thanks.

A renderer is a particular algorithm for converting graphics objects into
pixels. Different renderers have different advantages and disadvantages and
different limitations or bugs.

http://www.mathworks.com/support/tech-notes/1200/1201.html
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: Periodogram PSD of a white noise
Next: executable files