如何用不同的标记绘制多条线 [英] How to plot multiple lines with different markers

查看:80
本文介绍了如何用不同的标记绘制多条线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆