问题
I have a contour plot and I am using the current rendering:
set(gcf, 'renderer', 'zbuffer');
but it is giving me this thick red line in the plot and I don't know how to get rid of it. I tried switching to:
set(gcf, 'renderer', 'opengl');
but the quality is poor and I really need to have high quality images. Any suggestions?
回答1:
In general, I let MATLAB choose which renderer is most appropriate, which means leaving the RendererMode property of the figure set to its default value of auto
. A brief description of the current 'Renderer'
options can be found here.
I'll address your two problems separately:
A "thick red line" in the contour plot: Without seeing the code you use to make the contour plot, or a screenshot, I can't help you much with this other than to point out that you can control aspects of how the contour plot renders by setting certain contour plot properties. For example, you can control the line width by setting the
LineWidth
property:[C, h] = contour(peaks(20), 10); % Make a sample contour plot set(h, 'LineWidth', 3); % Make the lines thicker
Figure "quality": The choice of renderer doesn't so much adjust the quality per se. The renderer generally influences the accuracy and speed of the graphics rendering as well as the rendering options available (i.e. lighting, transparency, etc.). If you want better quality images from your figures, I would suggest downloading the submission Myaa by Anders Brun on The MathWorks File Exchange. It allows you to create anti-aliased graphics in MATLAB. Here's a screenshot from the submission illustrating the improved figure quality:
来源:https://stackoverflow.com/questions/1281947/rendering-and-image-quality-in-matlab-figures