scatter too slow

Hi, I want to plot particles according to their longitudes, and latitudes and to plot them according to their times (date of birth). That's why I used scatter(lon, lat, 4, time); It works very well for small numbers (10, 20,30,80), but When I use it with bigger numbers (I tried 9 000, and I need in reality 100 000), it's a crash, and I have to stop the process each time.
Does any body have a solution?

답변 (6개)

Sean de Wolski
Sean de Wolski 2012년 1월 20일

0 개 추천

Are you sure a 2-dimensional histogram viewed as a mesh or surf wouldn't better suit your needs? I have a lot of trouble believing that you'll be able to depict anything but a blob with 100000 points on most (all) monitors.
If you use a 2-dimensional histogram you'll be able to see how many points are in an area specificed by the size you need. I think this will be much more useful as a visualization/analysis tool.
If this is what you want, look at Bruno's: FEX:histcn
the cyclist
the cyclist 2012년 1월 20일

0 개 추천

This code executes successfully in about 30 seconds on my machine.
n = 100000;
x = rand(n,1);
y = rand(n,1);
c = rand(n,3);
tic
scatter(x,y,25,c);
toc
Are you embedding any calculations inside your plotting? For example, datenum() can take a notoriously long time to calculate.
Mariem
Mariem 2012년 1월 23일

0 개 추천

When I write the same code as you, I have to stop the process, because noting happens:
>>> n = 100000;
x = rand(n,1); y = rand(n,1); c = rand(n,3); tic scatter(x,y,25,c);
toc
>>>
>>>Elapsed time is 514.298 seconds.

댓글 수: 3

Walter Roberson
Walter Roberson 2012년 1월 23일
Which renderer are you using? get(gcf,'Renderer')
If it is OpenGL, then please use the command
opengl info
and look at the 'Software' line of the output. "false" corresponds to "opengl hardware" and "true" corresponds to "opengl hardware" (which would normally be faster.)
Sean de Wolski
Sean de Wolski 2012년 1월 23일
You're trying to draw 100000pts. Do you really think you'll be able to distinguish between them if they ever do draw?
Mariem
Mariem 2012년 1월 24일
yes, because after that, I will plot the particles according to the month, it's easy to do. My problem now is just how to display scatter.

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

Mariem
Mariem 2012년 1월 24일

0 개 추천

get(gcf,'Renderer')
>> painters
so I made >> set(gcf, 'Renderer', 'opengl')
>> set(0,'DefaultFigureRenderer','opengl')
but when I try opengl info or bench, octave doesn't recognize my command.
>>>error: `opengl' undefined near line 36 column 1.

댓글 수: 1

Walter Roberson
Walter Roberson 2012년 1월 24일
Octave... not many of us here have the experience to talk about what works well or does not work in octave.

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

per isakson
per isakson 2012년 1월 24일

0 개 추천

In the file exchange there are some contributions, which implement the approach I propose. E.g "plotc" and "Dot plot rather than scatter plot". There are more, but I cannot remember the names.
Mariem
Mariem 2012년 1월 24일

0 개 추천

I tried them, but I couldn't adapt them to my program, I am still a novice in octave.

카테고리

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

태그

질문:

2012년 1월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by