Hi folks! I have some surface plots that I'd like to label. I am plotting range vs fuel burn and altitude:
However, these 3d plots aren't the easiest to read, so I change the view angle to create a 2d plot of sorts:
What I would like to do is put labels on the horizontal lines (the contour lines) in the plot, so that in the 2d view, you can see the altitude that gives you that contour line. Is this possible? This is the current code:
fig = fsurf(range/burn(pow/100,alt/maxAlt), [0 maxAlt 0 100]);
title(strcat(aircraftNames(i)), ' Range vs Altitude, Speed');
xlabel('Altitude (ft)');
ylabel('Throttle (%)');
zlabel('Range (nmi)');
zlim("padded");
view(-75,15);
saveas(fig, strcat('Plots/3D/',regexprep(aircraftNames(i), '[\s.-]',''),'_3D'),'png');
view(90,0);
saveas(fig, strcat('Plots/2D/',regexprep(aircraftNames(i),'[\s.-]',''),'_2D'),'png');
Thanks for your help!

답변 (1개)

Kevin Holly
Kevin Holly 2021년 10월 3일
편집: Kevin Holly 2021년 10월 3일

0 개 추천

You can add text by entering the following:
text(0,30,160,'Text Label','Fontsize',12)
where 0, 30, and 160 are the x, y, and z coordinates.
Or you can insert the text in the figure by selecting Insert > text
After making edits, you can generate code. With this code you can generate another figure with the same format. You can also edit this code to suit your needs.

댓글 수: 1

Benjamin Cook
Benjamin Cook 2021년 10월 10일
Is there a way for labels to be automatically generated, like on the axes?

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

카테고리

제품

릴리스

R2021a

질문:

2021년 10월 2일

댓글:

2021년 10월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by