plot large dataset with sample points

Hello,
I would like to plot 2 large datasets (for comparison) using only sample points from each set so that markers can be clear (say 50 points). How will I do this and how do I choose these points from each dataset?
Thanks

답변 (1개)

Image Analyst
Image Analyst 2012년 12월 22일

0 개 추천

If a subset of the points would illustrate the situation just as well as the complete set, why not just select some of them at random?
indexesToUse = randperm(totalNumberOfPoints, numberToUse);

댓글 수: 4

Sam Alex
Sam Alex 2012년 12월 22일
You mean use these indices in an array to get the values that correspond to them, or is there a faster way?
Image Analyst
Image Analyst 2012년 12월 22일
Let's say that you have an array with 400,000 points and when you plot them all the graph becomes so cluttered that you can't really see what's going on. Well, perhaps you can see what's going on if you plot only 4,000 points instead of 400,000 points. With fewer points the graph will be far less cluttered and you can see better what's going on. That's what I mean.
Sam Alex
Sam Alex 2012년 12월 22일
True, but these indices always taken at random or is there a way better to represent the data from your experience?
Image Analyst
Image Analyst 2012년 12월 22일
They're not always taken at random, that's just one way. You could take just the first N of the points, though if there's a trend in the data you might want to take every 1000th point or so, like this dataSubSet = data(1:1000:end). Basically use whatever method that works for you.

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

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

태그

질문:

2012년 12월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by