MATLAB 图形中的渲染和图像质量

发布于 2024-08-01 18:09:45 字数 225 浏览 9 评论 0原文

我有一个等高线图,并且正在使用当前的渲染:

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

但它在图中给了我这条粗红线,我不知道如何摆脱它。 我尝试切换到:

set(gcf, 'renderer', 'opengl');

但质量很差,我确实需要高质量的图像。 有什么建议么?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧街凉风 2024-08-08 18:09:45

一般来说,我让 MATLAB 选择最合适的渲染器,这意味着保留 RendererMode 属性 设置为其默认值 auto。 当前'Renderer'选项的简要说明可以在这里

我将分别解决您的两个问题:

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:

    enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文