フィルターのクリア

How to use scatter function with different marker, markerFaceColor?

3 ビュー (過去 30 日間)
Yuanjie Su
Yuanjie Su 2019 年 9 月 16 日
コメント済み: Walter Roberson 2019 年 9 月 19 日
Here, I want to draw 3 points. Marker are 'o' , 'diamond' and '<'. MarkerEdgeColor are [0.19608 0.80392 0.19608], [0.72941 0.33333 0.83922] and [1,1,0]. How to use scatter once to draw these 3 points? I tried as following and failed.
x=[1,2,3];
y=x;
marker=['o','d','<'];
color=[0.19608 0.80392 0.19608;0.72941 0.33333 0.83922;1,1,0];
scatter(x,y,'Marker',marker,'MarkerFaceColor',color,'MarkerEdgeColor','k');
  5 件のコメント
Yuanjie Su
Yuanjie Su 2019 年 9 月 19 日
In fact, there are 5000+ points in my code.
Adam
Adam 2019 年 9 月 19 日
Well there aren't 5000 different types of marker anyway so how exactly do you want them to be grouped? You only need to do a sinigle scatter call per marker type, not for every single point. If you have 1000 points using the same marker type you can plot them all in one instruction, you just can't mix marker types in a single instruction.
Your example of 3 points, each with a different marker is not sufficient for us to understand what you want to do with 5000 though.

サインインしてコメントする。

回答 (2 件)

Yuanjie Su
Yuanjie Su 2019 年 9 月 16 日
I don't want to use for...loop statement which running too slowly.

Walter Roberson
Walter Roberson 2019 年 9 月 16 日
You will need to get a job or internship with Mathworks with the goal of extending the scatter object to handle multiple markers in a way that is backwards compatible (does not trigger a fault if the resulting object is loaded in an earlier version) and yet retains high performance for drawing.
There is no possibility in any released version of MATLAB to use multiple marker shapes for any one scatter or line or surface or patch object.
  2 件のコメント
Yuanjie Su
Yuanjie Su 2019 年 9 月 19 日
It may be difficult.
Walter Roberson
Walter Roberson 2019 年 9 月 19 日
In a crowded picture, once you get beyond about 5 different marker types, it can be difficult to distinguish them. You can group all of the points to be drawn with the same marker type into the same scatter() call.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by