colorbar's color failed with colormap longer than 1024 in scatter

I try to make a scatter plot and I have found out a problem with ploting colorbar, when length of x, y vectors and colormap is greater than 1024. I don't get errors, just the colorbar becomes grey.
This is a code which I run:
rnd = randn(2000,1);
idx = randi([1 1280],2000,1);
idy = randi([1 1024],2000,1);
l=1024;
figure;
markerSize=50;
map=colormap(jet(length(rnd(1:l))));
scatter(idx(1:l),idy(1:l),markerSize,map,'fill');
colorbar;
I change the length of these vectors and matrix with a parameter called 'l'. Now it is 1024 and I get a correct colorbar:
when I will change l for 1025 I get a grey colorbar:
What is the problem and how to solve it? I test Matlab R2014b Trial on Windows 7 Home Premium 64-bit. I have not found limitations of trial version on the mathworks webpage.

 채택된 답변

Mike Garrity
Mike Garrity 2014년 12월 2일

1 개 추천

That's usually caused by confusion about how large a texture map the graphics card can handle. Some opengl drivers will sometimes say that they can handle a texture that they really can't. Could you please send the output of "opengl info" to www.mathworks.com/support so that we can make sure we have the details on this one? Thanks.

댓글 수: 2

'opengl info' returns:
Version: '1.1.0'
Vendor: 'Microsoft Corporation'
Renderer: 'GDI Generic'
MaxTextureSize: 1024
Visual: 'Visual 0x1d, (RGB 24 bits (8 8 8), Z depth 16 ...'
Software: 'true'
SupportsGraphicsSmoothing: 0
SupportsDepthPeelTransparency: 0
SupportsAlignVertexCenters: 0
Extensions: {3x1 cell}
MaxFrameBufferSize: 0
and now probably I see this magic number (in MaxTextureSize). Is it possible to change it?
The best way learning MATLAB: look around in support area.
Learning new things all the time.
So, Anna, my 'OpenGL info' says:
Version: '2.1 NVIDIA-8.26.28 310.40.55b01'
Vendor: 'NVIDIA Corporation'
Renderer: 'NVIDIA GeForce GT 750M OpenGL Engine'
MaxTextureSize: 16384
Visual: 'Visual (Undefined), (RGBA 32 bits (8 8 8 8),...'
Software: 'false'
SupportsGraphicsSmoothing: 1
SupportsDepthPeelTransparency: 1
SupportsAlignVertexCenters: 1
Extensions: {138x1 cell}
MaxFrameBufferSize: 16384
and 1025 works for me. In fact it works up to 16384 and then 16385 becomes gray.

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

추가 답변 (0개)

카테고리

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

질문:

2014년 12월 2일

편집:

2014년 12월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by