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:
if remove colorbar command code above get:
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:
Comments
Post a Comment