Scatter plot: Data exclusion

3 ビュー (過去 30 日間)
wesleynotwise
wesleynotwise 2017 年 6 月 3 日
コメント済み: Star Strider 2017 年 6 月 5 日
I have my data stored in a table form, and I would like to have a scattered plot without certain data. How can this be done?
eg:
figure1 = gscatter (table1.x, table1.y, 'g', 'o')
% Let say the 1st, 5th and 10th data are to be excluded from Figure 1
% Looking for a function something like this
% figure1 = gscatter (table1.x, table1.y, 'g', 'o', 'Exclude', [1,5,10])

回答 (1 件)

Star Strider
Star Strider 2017 年 6 月 3 日
I don’t have your grouping variables, so I can’t include them.
Otherwise, this works:
x = randi(99, 15, 1);
y = randi(99, 15, 1);
table1 = table(x, y);
L = logical(ones(size(table1,1),1));
L([1,5,10]) = 0;
figure(1)
scatter(table1.x(L), table1.y(L))
  2 件のコメント
wesleynotwise
wesleynotwise 2017 年 6 月 5 日
Hello again! Thanks for the suggestion, been busy doing other stuff, will visit this code few days later :)
Star Strider
Star Strider 2017 年 6 月 5 日
My pleasure!
This does the same as the ‘Exclude’ option you want, since that’s not available by that name anywhere that I know of.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by