带有多个标记的散点图

Dou*_*ser 3 matlab markers scatter-plot

我试图将散点图从多个数据文件放在一起,看看它们之间是如何相互关联的.代码如下所示:

hold all
fia = fopen('data.txt');
A = fscanf(fia, '%f %f %f', [3 inf]);
t = A(1,:);
a = A(2,:);
r = A(3,:);

figure(1)
scatter(log(r),log(a),'r', '-');

fclose(fia);

fia = fopen('data.txt');
A = fscanf(fia, '%f %f %f', [3 inf]);
t = A(1,:);
a = A(2,:);
r = A(3,:);

figure(2);
scatter(log(r),log(a), 'g', '-');

fclose(fia);
Run Code Online (Sandbox Code Playgroud)

依此类推,下一个数据点绘制在同一个图表上:

fia = fopen('data.txt');
A = fscanf(fia, '%f %f %f', [3 inf]);
t = A(1,:);
a = A(2,:);
r = A(3,:);

figure(1);
scatter(log(r),log(a), 'rx');


fclose(fia);
Run Code Online (Sandbox Code Playgroud)

等.

但是当我在Matlab中运行该函数时,我收到此错误:

Error using specgraph.scattergroup/set
The name 'linestyle' is not an accessible property for an instance
of class 'scattergroup'.

Error in specgraph.scattergroup (line 26)
  set(h,args{:});

Error in scatter (line 83)
        h = specgraph.scattergroup('parent',parax,'cdata',c,...

Error in Ratioincrease (line 11)
scatter(log(r),log(a),'r', '-');
Run Code Online (Sandbox Code Playgroud)

如何将散点组与线组相似,如何正确编写?

bla*_*bla 6

应该没有问题使用scatter和显示不同的标记.例如:

load seamount
scatter(x,y,30,z,'s'); hold on
scatter(.999*x,1.001*y,30,z,'x'); hold on
scatter(1.001*x,.999*y,30,z,'+'); hold on
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我怀疑你有一个拼写错误并用作-标记类型.您可以使用的标记类型是:

  • '+' 加号
  • 'o'
  • '*' 星号
  • '.'
  • 'x' 交叉
  • 'square''s' 广场
  • 'diamond''d'钻石
  • '^' 向上指的三角形
  • 'v' 向下三角形
  • '>' 右指三角形
  • '<' 左指三角形
  • 'pentagram''p'五角星(五角星)
  • 'hexagram''h' 六角星(六芒星)