Turn off line smoothing (anti-aliasing) in 2014b?

조회 수: 4 (최근 30일)
matt dash
matt dash 2014년 12월 12일
댓글: matt dash 2014년 12월 13일
Is there a way to turn off line smoothing for selected objects (line objects in particular) in 2014b? I mean, it's great and all, but for some graphics having perfectly unaliased lines is better. I tried setting the line smoothing property to off, but this seems to have no effect (and produces a warning)
Consider e.g. this:
figure
axes
line([0 1],[.5 .5])
line([.5 .5],[0 1])
For me this gives a perfect 1 pixel line for the horizontal line, but a lighter blue 2 pixel wide line for the vertical one.
(Resizing the axes makes the lines alternate between 1 and 2 pixels wide)

답변 (1개)

Sean de Wolski
Sean de Wolski 2014년 12월 12일
편집: Sean de Wolski 2014년 12월 12일
fig = figure;
fig.GraphicsSmoothing = 'off';
plot(1:10)
  댓글 수: 1
matt dash
matt dash 2014년 12월 13일
That turns it off for the entire figure though, which is too restrictive for what I need. E.g. if i'm making a plot and manually drawing grid lines, i like a nice uniform grid, but i'd like to leave the main data series anti-aliased.
I found the "AlignVertexCenters" property, which turns off antialiasing at least for perfectly vertical or horizontal line segments. I think this will be adequate for most of my purposes. Unfortunately it looks like for patches this property only affects the edges, not the faces, so when plotting a patch with no edge, it still has slightly fuzzy borders. (E.g. i use patches to draw bar graphs, and they have this problem.)
Follow up question: AlignVertexCenters says it only works if your graphics card supports it. Can anyone tell me the consequence of setting this property on a computer that doesnt support it? Does it give an error or warning, or it just has no effect? I'm making GUIs for use on multiple platforms and i want to make sure they don't break.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by