Colorbar in MATLAB placing too many numbers in figure

耗尽温柔 提交于 2020-01-05 04:17:06

问题


I'm trying to make contour map and have been stuck putting a colorbar onto the figure. I am currently using the following code:

abi = -7:0.1:4;
sbi = 0:1:75;
[xx, yy] = meshgrid(sbi(2:end), abi(2:end));
contour(xx', yy', rm3d);
colorbar;

Where rm3d is a set a values corresponding to each intersection point between abi and sbi.

Everything works as expected through the contour line, but the colorbar does something funky. Looks like it is populating numbers across the screen, as in this picture:

Only problem is that when I export this figure (as a *.png), it looks just fine:

Anyone have any idea of the issue with the non-exported image? Resizing the image did not help.

Thanks.


回答1:


As described in the comments, the solution is to use:

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

As explained on http://www.mathworks.nl/matlabcentral/answers/53874



来源:https://stackoverflow.com/questions/18021851/colorbar-in-matlab-placing-too-many-numbers-in-figure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!