why sometimes the figure become none Anti-aliasing?

8 views (last 30 days)
why sometimes when I change some figure property, the figure become lose their anti-aliasing effects? eg: when I generate a bar figure.I change the FaceVertexCData property using 3-color vector it become none anti-aliasing. But when I use color index ,it will not appear.How does this happen?
eg:
s=[1 2 3 4];
b=bar(s);
hl=get(b,'children');
set(hl,'FaceVertexCData',[1;2;3;4]) %this is Ok,and anti-aliasing.
set(hl,'FaceVertexCData',[1 1 1;0 1 1; 1 1 0;1 1 1]) % this become none anti-aliasing.
The code was tested on matlab 2012a

Answers (1)

Jan
Jan on 16 May 2013
Wow, niuniu, without undocumented tricks I do not even know any anti-aliasing in Matlab figures.
Usually automatic changes of graphic properties depend on the renderer mode:
get(gcf, 'RendererMode')
get(gcf, 'Renderer')
If the mode is "auto", Matlab decides automatically, if ZBuffer, Painters or OpenGL is activated as renderer. Perhaps you graphics driver anti-aliases for the OpenGL rendering, but this would be surprising for me. But I use an older R2011b version older, so perhaps other users con confirm your observations.
  2 Comments
niuniu
niuniu on 16 May 2013
Thanks for answer! I test it again.using "set(hl,'FaceVertexCData',[1;2;3;4])" the renderermode is "auto", and renderer is painters. the fonts in the figure show a smooth edge. using "set(hl,'FaceVertexCData',[1 1 1;0 1 1; 1 1 0;1 1 1])" the renderer mode is "auto" and renderer is OpenGl.The fonts no longer smooth any more.I change the renderer to painters, there will be no bar in the figure, but the fonts become smooth.should I update my graphics driver or change another font?
Jan
Jan on 16 May 2013
Updating the drivers is a good idea in general. But the problem remains that OpenGL is a pixel oriented driver, which cannot anti-alias text. You can try the built-in software renderer:
opengl software
Using another font or font size might be helpful also. For some fonts there are no nice pixel-representations in all font sizes. So sometimes the 12 point font is an ugly expanded 11 point font face.

Sign in to comment.

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!