plot - Colorbar repeating range labels in Matlab -


i'm plotting data in matlab , when add colorbar plot range labels drawn repeatedly plot. here minimal working example:

events = 1000000;  x1 = sqrt(0.05)*randn(events,1)-0.5; x2 = sqrt(0.05)*randn(events,1)+0.5;  y1 = sqrt(0.05)*randn(events,1)+0.5; y2 = sqrt(0.05)*randn(events,1)-0.5;  x= [x1;x2]; y = [y1;y2];  %for linearly spaced edges:  xedges = linspace(-1,1,64); yedges = linspace(-1,1,64);  histmat = hist2(x, y, xedges, yedges);  figure; pcolor(xedges,yedges,histmat'); colorbar ; axis square tight ; 

you can hist2-function here:

http://www.mathworks.com/matlabcentral/fileexchange/9896-2d-histogram-calculation/content/hist2.m

this running code:

enter image description here

if remove colorbar command code above get:

enter image description here

any ideas why problem occurring? have met problem before also... operating system 64-bit windows 7 enterprise , have matlab r2012b (8.0.0.783)

thank :)

as user @nkjt stated answer problem can found here:

http://www.mathworks.nl/matlabcentral/answers/53874

for me following piece of code worked:

set(gcf, 'renderer', 'zbuffer'); 

and resulted as:

enter image description here


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -