How to label points on a plot, when data is imported from a matrix?
显示 更早的评论
I have a code that outputs a number of graphs. At each data point I wish to place next to it a label that says n=1, ...., n=6, corresponding to each data point on the graph. Here is the code I have:
D= load('Convergence.csv');
A=D(:,1);
B=D(:,2);
figure(1);
plot(A,B,'-O','LineWidth',3,'MarkerSize',10,'MarkerFaceColor','[0.9100 0.4100 0.1700]');
xlabel ('Number of Cells','LineWidth',3);
ylabel('Velocity [m/s]')
grid
C=D(:,3);
figure(2);
plot(A,C,'-O','LineWidth',3,'MarkerSize',8,'MarkerFaceColor','[0.9100 0.4100 0.1700]');
xlabel('Number of Cells');
ylabel('Velocity [m/s]');
grid
d=D(:,4);
figure(3);
plot(A,d,'-O','LineWidth',3,'MarkerSize',10,'MarkerFaceColor','[0.9100 0.4100 0.1700]');
xlabel('Number of Cells');
ylabel('Velocity [m/s]');
grid
E=D(:,5);
figure(4);
plot(A,E,'-O','LineWidth',3,'MarkerSize',10,'MarkerFaceColor','[0.9100 0.4100 0.1700]');
xlabel('Number of Cells');
ylabel('Surface Average Pressure Coefficient');
grid
F=D(:,5);
figure(4);
plot(A,F,'-O','LineWidth',3,'MarkerSize',10,'MarkerFaceColor','[0.9100 0.4100 0.1700]');
xlabel('Number of Cells');
ylabel('Mass Flow Rate [kg/s]');
grid
回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!