Problems with plotting multiple objects

Hi! I have a question. There are the label of contour on the rectangle. Can I delete this for a better reading? Thank you
This is the code for the graphic part.
[c,cc]=contour(x,y,u',[13.1,13.5,14,14.5,15,15.5,15.9]);
clabel(c,cc,'LabelSpacing',72,'Color','r','FontWeight','normal');
rectangle('position',[0,0,Lx,Ly])
rectangle('position',[x(6),y(4),d,3*d],'FaceColor',[0.5 0.5 0.5],'LineWidth',1)
axis('equal');
set(cc,'ShowText','on');
colormap cool;
axis([0 Lx 0 Ly]);
hold on;
streamline(x,y,qx,qy,[x(2:4),x(9:nx)], y(ny+1)*ones(1,6));
quiver(x(2:5),y(2:ny),qx(2:ny,2:5),qy(2:ny,2:5),'b');
quiver(x(8:nx),y(2:ny),qx(2:ny,8:nx),qy(2:ny,8:nx),'b');
quiver(x(6:7),y(2:3),qx(2:3,6:7),qy(2:3,6:7),'b');
trimesh(T,P(:,1),P(:,2),hh);
title('Sheet pile wall');
xlabel('x');ylabel('y');zlabel('z');

답변 (2개)

MICHELA VOLGARE
MICHELA VOLGARE 2018년 12월 14일

0 개 추천

If I remove this line
clabel(c,cc,'LabelSpacing',72,'Color','r','FontWeight','normal');
the numbers are black, not "red".
And with "off" i remove all numers, not only on rectangle.
set(cc,'ShowText','on');
I want hide numbers only on rectangle.

댓글 수: 1

Adam Danz
Adam Danz 2018년 12월 14일
편집: Adam Danz 2018년 12월 14일
Now that I understand what rectangle you mean, I removed my previous answer and added a new one. If you have any follow-up comments, reply to my answer or to the comment section under your quesiton rather than adding an 'answer' that isn't an answer.

댓글을 달려면 로그인하십시오.

Adam Danz
Adam Danz 2018년 12월 14일
편집: Adam Danz 2018년 12월 14일

0 개 추천

I assume you're talking about the gray rectangle created by this line:
rectangle('position',[x(6),y(4),d,3*d],'FaceColor',[0.5 0.5 0.5],'LineWidth',1)
2 options:
Option 1. Plot the rectangle at the end of the code so it's on top of everything else.
Option 2. Save the handle to the rectangle and then after the rest of the plot is created, put the object on top of the UI stack.
rh = rectangle('position',[x(6),y(4),d,3*d],'FaceColor',[0.5 0.5 0.5],'LineWidth',1);
% the rest of your code is here..... then at the end, the next line
uistack(rh, 'top')
Note that if the rectangle is on top, it will also cover the contour lines so you may want to play around with the uistack() to position the rectangle so that you can see the contour lines but not the lables (if possible). For example, uistack(rh, 'up').

댓글 수: 3

MICHELA VOLGARE
MICHELA VOLGARE 2018년 12월 15일
Nope, nothing :(
Adam Danz
Adam Danz 2018년 12월 15일
"Nope, nothing "
What does that mean?
MICHELA VOLGARE
MICHELA VOLGARE 2018년 12월 16일
...

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Contour Plots에 대해 자세히 알아보기

질문:

2018년 12월 13일

댓글:

2018년 12월 16일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by