如何用不同的标记绘制多条线 [英] How to plot multiple lines with different markers
问题描述
我想用 MATLAB 绘制多行,并这样做,标记将是每行都不同.我知道使用颜色可以通过ColorSet = hsv(12);
来实现.有没有像这种标记方法那样简单的方法?
I would like to plot multiple lines with MATLAB and do it so, that markers would be different in every line. I know that with colours this would be achieved with ColorSet = hsv(12);
. Is there some as simple as this method for markers?
推荐答案
好吧,我不知道 MATLAB 这样做,但是我要执行以下操作.我创建了自己的单元格:
Well, I am not aware of a built-in functionality of MATLAB to do so, but I do the following. I create my own cell:
markers = {'+','o','*','.','x','s','d','^','v','>','<','p','h'}
,然后以这种方式访问它:
and then access it this way:
markers{mod(i,numel(markers))+1}
我还创建了一个函数getMarker
,该函数可以将其添加到MATLAB的路径中,以便可以在所有脚本中对其进行访问.
I also created a function, getMarker
, that does that and that I added to the path of MATLAB so that I can access it in all my scripts.
这篇关于如何用不同的标记绘制多条线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!