MATLAB Figure Rendering: OpenGL vs. Painters?

 ̄綄美尐妖づ 提交于 2019-12-06 05:19:30

问题


I'm clueless when it comes to which renderer to use for MATLAB figures or when it matters, but I have come across certain examples where it does matter:

plot(0,0,'ko','markersize',50,'linewidth',8);
set(gcf,'renderer','opengl');
set(gcf,'renderer','painters');

Left=OpenGL, Right=Painters:

(running Windows 7 Professional and MATLAB R2015b)

Are there times when using the OpenGL renderer produces better results than Painters? In general how do the two renderers differ?


回答1:


These are the differences I know of

  • OpenGL is the default renderer
  • OpenGL allows to plot transparency and Painter does not
  • If there is a graphical bug when using OpenGL or if Matlab crashes, use Painter
  • Select Painter to export figures in postscript format. Using OpenGL when the figure gets too complex, Matlab saves as Bitmap and you cannot edit it.

From the Mathworks website (Scroll down to "renderer"):

  • 'opengl' — OpenGL® renderer. This option enables MATLAB to access graphics hardware if it is available on your system. The OpenGL renderer displays objects sorted in front to back order, as seen on the monitor. Lines always draw in front of faces when at the same location on the plane of the monitor.

  • 'painters' — Painters renderer. This option works well for axes in a 2-D view. In 2-D, the Painters renderer sorts graphics objects by child order (order specified). In 3-D, the Painters renderer sorts objects in front to back order. However, it might not correctly draw intersecting polygons in 3-D.

See also this link on fixing low level graphics issues with OpenGL.



来源:https://stackoverflow.com/questions/33742132/matlab-figure-rendering-opengl-vs-painters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!