Grabbing points from scatter plot

조회 수: 3 (최근 30일)
Ahmed Abdulla
Ahmed Abdulla 2020년 6월 18일
답변: Ameer Hamza 2020년 6월 19일
I have 2 matrices and i plotted them on a scatter plot and i would like to highlight some points from the plot and discard all the other data points from the matrices i generated the scatter plot from. Is this possible.
e.g my plot is made out of 1000 data points and i would like to select 25 points from the plot and discard all the other data points from the matrices with the data.
Really Sorry if this is not possible or not clear
  댓글 수: 1
Geoff Hayes
Geoff Hayes 2020년 6월 18일
Ahmed - how do you plan to select the 25 points to keep?

댓글을 달려면 로그인하십시오.

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 6월 19일
This shows how you can randomly select points from the complete dataset
x = rand(1000, 1);
y = rand(1000, 1);
idx = randperm(1000, 25); % randomly select 25 points
scatter(x(idx), y(idx))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by