繁体   English   中英

在绘制矢量时绘制点:Matlab

[英]Plotting points while plotting vectors : Matlab

我需要制作一个只有点的情节,并尝试类似的东西

plot(x,y)

其中xy是向量:点的集合。

我不希望matlab本身连接这些点。 我想绘制好像用绘图一样

for loop
plot;hold on;
end

我试过了

plot(x,y,'.');

但这给了我太厚的分数。

我不想使用forloop,因为它耗时。 这需要很多时间。

你几乎就在那里,只需更改MarkerSize属性:

plot(x,y,'.','MarkerSize',1)

尝试:

plot(x,y,'*');

要么

plot(x,y,'+');

您可以查看文档: http//www.mathworks.nl/help/matlab/creating_plots/using-high-level-plotting-functions.html

帮助分散

IIRC:其中S是散点的大小:散射(x,y,S)

您可以尝试避免使用循环的这段代码。 创建的绘图没有行,但是对应于矩阵xy每列的不同颜色的标记。

%some data (matrix)
x = repmat((2:10)',1,6);
y = bsxfun(@times, x, 1:6);

set(0,'DefaultAxesColorOrder', jet(6)); %set the default matlab color 

figure('Color','w');
plot(x,y,'p'); %single call to plot
axis([1 11 0 70]);
box off;
legend(('a':'f')');

这给了

在此输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM