MATLAB中的Colorbar在图中放置了太多数字 [英] Colorbar in MATLAB placing too many numbers in figure
问题描述
我正在尝试绘制等高线图,并且一直被困在图形上放置一个颜色条.我目前正在使用以下代码:
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;
其中rm3d是一组与abi和sbi之间的每个交点相对应的值.
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:
唯一的问题是,当我导出该图形(作为* .png文件)时,它看起来还不错:
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.
谢谢.
推荐答案
如注释中所述,解决方案是使用:
As described in the comments, the solution is to use:
set(gcf, 'renderer', 'zbuffer')
如 http://www.mathworks.nl/matlabcentral/answers/53874
As explained on http://www.mathworks.nl/matlabcentral/answers/53874
这篇关于MATLAB中的Colorbar在图中放置了太多数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!