Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
text always overlaying patches?

Subject: text always overlaying patches?

From: Matthias

Date: 21 Jun, 2006 05:53:01

Message: 1 of 7

I want to plot several patches and textes and have following problem.
Naturally the last plotted Graphic object is in the front and
overlaying the previous plotted one.

e.g
figure
text(0.98,0.5,'test.......test');
vek= [0 0; 0 1; 1 1; 1 0];
fac= [1 2 3 4];
patch('vertices',vek,'faces',fac,'facecolor',[1 1 0]);

The text is no behind the patch, but if I start to use the
FacevertexCData to specify the color of the single faces the text is
alway in the front an overlaying the patch.

figure
text(0.98,0.5,'test.......test');
vek= [0 0; 0 1; 1 1; 1 0];
fac= [1 2 3 4];
tcolor=[1 0 1]
patch('vertices',vek,'faces',fac,'FacevertexCData',tcolor,'facecolor',
'flat');

Does anybody have a explanation for this beaviour?
Any help/advice is welcome.

regards

Subject: text always overlaying patches?

From: PeterN

Date: 21 Jun, 2006 08:51:00

Message: 2 of 7

help uistack

Subject: text always overlaying patches?

From: Matthias

Date: 22 Jun, 2006 05:56:12

Message: 3 of 7

PeterN wrote:
>
>
> help uistack
>
>
Hi,
I tried to restack the text/patch and it is working fine for the
patch without specifying the FaceVertexCData. But when I specify it
uistack shows no result.
When I geht the vektor of the children and re-sort it it changes the
overlaying object until the FaceVertex.. is specified. Then the order
in the children vektor has no influence on the stacking order.
Quite confusing to me.

Subject: text always overlaying patches?

From: PeterN

Date: 22 Jun, 2006 09:40:43

Message: 4 of 7

You are right and I am puzzled. -- PeterN

> Hi,
> I tried to restack the text/patch and it is working fine for the
> patch without specifying the FaceVertexCData. But when I specify it
> uistack shows no result.
> When I get the vector of the children and re-sort it it changes the
> overlaying object until the FaceVertex.. is specified. Then the order
> in the children vektor has no influence on the stacking order.
> Quite confusing to me.

Subject: text always overlaying patches?

From: Christophe

Date: 5 Jul, 2006 05:13:13

Message: 5 of 7

PeterN wrote:
>
>
> You are right and I am puzzled. -- PeterN
>
>> Hi,
>> I tried to restack the text/patch and it is working fine for
the
>> patch without specifying the FaceVertexCData. But when I
specify
> it
>> uistack shows no result.
>> When I get the vector of the children and re-sort it it changes
> the
>> overlaying object until the FaceVertex.. is specified. Then the
> order
>> in the children vektor has no influence on the stacking order.
>> Quite confusing to me.
>
>
  
Hi,
I seem to have a similar problem. I am trying to make a figure with a
candlestick plot on one axis and volumes on the second axis. I
construct the candles by using 'line' overlayed by 'patch'. This
works fine this far. However, when I plot volumes ('bar' plot) on the
second axis, suddenly the stack order is changed in the first axis,
so that the lines overlay the patches. Even using the handle to the
patches combined with uistack does not help:

uistack(handle, 'top')

did you find a sollution to your stack problem? Is there a matlab
bug?

Christophe

Subject: text always overlaying patches?

From: Jerome

Date: 5 Jul, 2006 08:59:12

Message: 6 of 7

Christophe wrote:
> Even using the handle to the
> patches combined with uistack does not help:

Hi,

did you try with UISTACK2 from the File EXchange ?

 <http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=9707&objectType=FILE>

Jérôme

Subject: text always overlaying patches?

From: Matthias

Date: 7 Jul, 2006 04:16:29

Message: 7 of 7

Jérôme wrote:
>
>
> Christophe wrote:
>> Even using the handle to the
>> patches combined with uistack does not help:
>
> Hi,
>
> did you try with UISTACK2 from the File EXchange ?
>
> <http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=9707&objectType=FILE>
>
> Jérôme

Unfortunately it does not work with the my problem with the text and
the patches.
In the latest release (R2006a) the text is now overlaying the patch
every time and I have found no way to fix it so far.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us