MATLAB 图形中的渲染和图像质量
我有一个等高线图,并且正在使用当前的渲染:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一般来说,我让 MATLAB 选择最合适的渲染器,这意味着保留
RendererMode
属性 设置为其默认值auto
。 当前'Renderer'
选项的简要说明可以在这里。我将分别解决您的两个问题:
等值线图中的“粗红线”:没有看到您用来制作等值线图的代码或屏幕截图,我无法除了指出您可以控制 的各个方面之外,在这方面对您有很大帮助等高线图通过设置某些等高线图属性。 例如,您可以通过设置
LineWidth
属性来控制线宽:图形“质量”: 渲染器的选择并不会太多调整 质量本身。 渲染器通常会影响图形渲染的准确性和速度以及可用的渲染选项(即照明、透明度等)。 如果您希望从数字中获得更好的质量图像,我建议您下载提交的内容Myaa,作者:Anders Brun,发表于 MathWorks 文件交换。 它允许您在 MATLAB 中创建抗锯齿图形。 以下是提交的屏幕截图,说明了图形质量的改进:
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 ofauto
. 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: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: