Changing annotation size or font

조회 수: 2 (최근 30일)
Nadine Nassar
Nadine Nassar 2020년 11월 15일
댓글: Mario Malic 2020년 11월 15일
Hello,
I'm having trouble fixing the annotations on my graph. For the annotations at the throat and exit, the value isn't that clear. Is there any reason why it's like this, and if I can change it so it's more clear? I've attached the code and a picture of my plot.
Thanks in advance
plot(i,r1(l), '.b'); hold on
plot(i,r2(l),'.b'); hold on
yline(0,'-.k');
xline(0,'-.r');
xline(-L/2,'-.r');
xline(L,'-.r');
title ('Plot of Nozzle Shape');
xlabel('Axial distance from the throat (mm)');
ylabel('Radius (mm)');
txt1 = ['Throat, d=' num2str(2*min(r1)) 'mm'];
text(0,1,txt1);
txt2 = ['Inlet, d=' num2str(2*r1(1)) 'mm'];
text(-L/2,1,txt2);
txt3 = ['Exit, d=' num2str(2*r1(end)) 'mm'];
text(0.85*L,1,txt3)

채택된 답변

Mario Malic
Mario Malic 2020년 11월 15일
Is your piece of code in for loop?
Guessing that r1(1) and r1(end) are changing and there are many different texts on top of each other.
  댓글 수: 4
Nadine Nassar
Nadine Nassar 2020년 11월 15일
Okay, i'll change it. I also tried your suggestion of not using a for loop and I got the same results, and realised the computational time was much faster this time. The text on the plot is also fixed now.
Thanks a lot for yor help
Mario Malic
Mario Malic 2020년 11월 15일
Cool! You're welcome.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by