我已经实现了一个算法,这是我资源手册中的一个图:

我是Matlab的新手.我有一个xValues列表,yValues列表(我已将我的最终矩阵划分为x和y轴,我不确定是真的,如果你提出建议,欢迎你)和标签矢量.
我想像上面那样得到一个图像.如何像给定图像一样放置一些类标签(即0,1,2,3 ..)?
PS:我的情节就像那样:plot(xValues,yValues,'b.');不过我的圆点就像钻石一样,不像图像那样点.
您可以用来text在场景上绘制文本。(Matlab帮助:)
text(X,Y,'string') adds the text in the quotes to location (X,Y)
on the current axes, where (X,Y) is in units from the current
plot.
Run Code Online (Sandbox Code Playgroud)
您需要知道要在图表上的何处绘制文本,但您可以这样做:
x = -pi:.1:pi;
y = sin(x);
p = plot(x,y)
text(-pi/4,sin(-pi/4),'7')
text(-pi/4+1,sin(-pi/4),sprintf('%d', 8))
text(-pi/4+2,sin(-pi/4),'9')
Run Code Online (Sandbox Code Playgroud)
这会给你这个:

您可以使用常规的 matlab 注释添加不同的文本样式等。您还可以使用 sprintf 命令自动添加集群所需的数字,正如我在绘制 8 时所示的那样。
祝你好运。