Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我要构建的人物的属性如下:
图中显示 200 个点。对角线上方的点应该用红色星标显示,对角线下方的点应该用蓝色三角形显示。
这是我到目前为止所做的
x=[0 1]; y=[0 1]; line(x,y, 'linewidth', 1); hggroup = scatter(rand(100,1),rand(100,1)); axis tight; axis square; title('Scatterplot')
你能帮我解决这个问题吗?提前致谢。
这个怎么样:
line([0 1],[0 1], 'linewidth', 1); hold on x = rand(100,1); y = rand(100,1); idx = y>x; scatter(x(idx),y(idx),'r*'); scatter(x(~idx),y(~idx),'b^'); axis tight; axis square; title('Scatterplot')