MATLAB-在散点图上绘制多个数据集 [英] MATLAB - Plot multiple data sets on a scatter plot

查看:554
本文介绍了MATLAB-在散点图上绘制多个数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两组数据,(Ax,Ay; Bx,By).我想将这两个数据集绘制在具有不同颜色的散点图上,但是我似乎无法使其正常工作,因为scatter()似乎不像plot()那样工作.可以这样做吗?

I have two sets of data, (Ax, Ay; Bx, By). I'd like to plot both of these data sets on a scatter plot with different colors, but I can't seem to get it to work, because it seems scatter() does not work like plot(). Is it possible to do this?

我尝试过...

scatter(Ax, Ay, 'g', Bx, By, 'b')

还有

scatter(Ax, Ay, 'g')
scatter(Bx, By, 'b')

第一种方法返回错误.后者仅绘制Bx/By数据.

The first way returns an error. The latter only plots the Bx/By data.

推荐答案

在第二个示例中尝试使用hold on.

Try using hold on with the second example.

这篇关于MATLAB-在散点图上绘制多个数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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