Scatter Plot and Contours

2 ビュー (過去 30 日間)
Harry
Harry 2017 年 3 月 30 日
回答済み: Star Strider 2017 年 3 月 30 日
I would like to include contours in my scatter plot to differentiate between sets of data (2 in this case).
Does anyone know what I would have to adjust in my code to get a similar result as in the picture attached?
Thanks in advance
figure
Size = 50;
hold on
HS = scatter(F(1:10,1),F(1:10,2),'+','SizeData',Size,'MarkerEdgeColor',[0 0 1],'MarkerFaceColor',[0 0 1]);
FO = scatter(F(21:30,1),F(21:30,2),'+','SizeData',Size,'MarkerEdgeColor',[1 0.8 0.2],'MarkerFaceColor',[1 0.8 0.2]);
FT = scatter(F(31:40,1),F(31:40,2),'+','SizeData',Size,'MarkerEdgeColor',[1 0.8 0.2],'MarkerFaceColor',[1 0.8 0.2]);
FK = scatter(F(41:50,1),F(41:50,2),'+','SizeData',Size,'MarkerEdgeColor',[1 0.8 0.2],'MarkerFaceColor',[1 0.8 0.2]);
  1 件のコメント
Harry
Harry 2017 年 3 月 30 日
Alternatively, it would also be useful to be able to connect data points with an arrow like in this picture:
Any help is appreciated!

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

回答 (1 件)

Star Strider
Star Strider 2017 年 3 月 30 日
It would be best to classify them first and let the classification function determine the contours. See the documentation for the classify (link) function for that and plotting the results.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by