필터 지우기
필터 지우기

Scatter plot mutiple dataset

조회 수: 52 (최근 30일)
James
James 2015년 6월 7일
댓글: Image Analyst 2015년 6월 7일
I trying to scatterplot multiple data plots but cannot seem to do it correctly.
I tried
scatterplot(data1);
hold on
scatterplot(data2);
I just receive 2 figures with each separate scatterplot.. How do i put into one.. I have to merge 94 dataset into one scatterplot.. So...

답변 (2개)

Image Analyst
Image Analyst 2015년 6월 7일
Try scatter() instead:
scatter(data1(:, 1), data1(:, 2));
hold on
scatter(data2(:, 1), data2(:, 2));
  댓글 수: 2
James
James 2015년 6월 7일
That seem to work.. Do have any idea on how to not manually plot each individual dataset?
Image Analyst
Image Analyst 2015년 6월 7일
What's wrong with the code? How is this "manual" and not "automatic"? scatter() does nearly all the work (all you have to do is to simply call it) - isn't that "automatic"? And what difference does it make as long as it does the job?

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


Walter Roberson
Walter Roberson 2015년 6월 7일
h = scatterplot(data1);
hold on
scatterplot(data2, h);
You might need to provide all of the arguments for the second call to scatterplot(); see the documentation page.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by