How to change the position of labels on plot?
72 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Haya Ali
am 19 Okt. 2021
Kommentiert: Haya Ali
am 19 Okt. 2021
I want to create a distance (a little bit upward) between the data points and the labels as indicated in figure attached. Please help.
data = [1,0,3.8*10^8
2,1,4.2*10^7
3,2,1.5*10^7
4,3,7.8*10^7] ;
x = data(:,1) ;
y = data(:,2) ;
z = data(:,3) ;
dy=1
f=figure;
t=tiledlayout("flow");
nexttile(t);
s=scatter3(x,y,z,'filled');
%xlabel('${\it} (A^{2}/B)^{1/4}$','Interpreter','Latex')
xlabel('${\omega}$','Interpreter','Latex')
ylabel('Y(m)')
zlabel('Y(m)')
labels=["A","B","C","D"];
text(x,y,z,labels,"HorizontalAlignment","center","VerticalAlignment","bottom");
0 Kommentare
Akzeptierte Antwort
Chunru
am 19 Okt. 2021
Add a number to z in "text" command.
data = [1,0,3.8*10^8
2,1,4.2*10^7
3,2,1.5*10^7
4,3,7.8*10^7] ;
x = data(:,1) ;
y = data(:,2) ;
z = data(:,3) ;
dy=1
f=figure;
t=tiledlayout("flow");
nexttile(t);
s=scatter3(x,y,z,'filled');
%xlabel('${\it} (A^{2}/B)^{1/4}$','Interpreter','Latex')
xlabel('${\omega}$','Interpreter','Latex')
ylabel('Y(m)')
zlabel('Y(m)')
labels=["A","B","C","D"];
text(x,y,z+8e6,labels,"HorizontalAlignment","center","VerticalAlignment","bottom");
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!