Rendering and image quality in MATLAB figures

后端 未结 1 1856
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-09 00:03

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

相关标签:
1条回答
  • 2020-12-09 00:37

    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:

    0 讨论(0)
提交回复
热议问题