Pixelated text in figures using text() function
이전 댓글 표시
Hi,
The text() function when adding text to figures seems to me misbehaving. The text is noticeably pixelated when compared to all the other figure text, both on my monitor, and also when I print out to jpg, see

Any hints about settings that could fix this? How do I make the text look more like the default figure text? The pixelation becomes glaringly ugly when projected onto a big screen.
댓글 수: 2
Chad Greene
2015년 2월 3일
I've noticed this too. The "improved" graphics of R2014b also make circle 'ro' markers look awful.
Hrefna
2015년 2월 4일
채택된 답변
추가 답변 (1개)
Mike Garrity
2015년 2월 4일
There are an awful lot of variables in play during font rasterization. I'd have to know a lot more about what you're doing. Here's the closest I was able to get by guessing:
figure
h(1) = plot(randi(10,[1 40]),55+40*rand(1,40),'ro')
hold on
h(2) = plot(randi(10,[1 40]),55+40*rand(1,40),'bx')
t(1) = text(1.5,83,'text(1.5, 83, ThisTest and ABCDEFGHIJKLMNOPQRSTUVXYZ)')
t(2) = text(1.5,62,'text(1.5, 62, ThisText and abcdefhijklmnopqrstuvxyz 123456789)')
ylabel ylabel
xlabel xlabel
set(h,'LineWidth',2)
t(2).FontSize = 16
grid on
legend('Red Legend','Blue Legend','Location','SouthEast')
set(gcf,'Color','white')
l = line([1 10],[80 80],'LineWidth',2,'Color','black')
print -djpeg -r150
Which results in the following on my windows box:

If you zoom in on the two images you'll see that they're close, but there are some artifacts in your text which aren't in mine. If I guessed reasonably closely, I would wonder about things like:
- What platform (windows, linux, mac) you're on
- Whether you've got unusual fonts installed
- What 'opengl info' says
- What get(0,'ScreenPixelsPerInch') says
But there are lots of other variables to consider. It looks like you've got GraphicsSmoothing and FontSmoothing turned on, is that correct? This looks like Helvetica, is that correct? Are you seeing the same issue with other fonts? I assume that your figure's Renderer is opengl, although that shouldn't make that much of a difference in R2014b.
The reason I'm asking is that I'm planning to do some posts on the graphics blog about how text gets drawn, but it's a fairly complex area. I'd like to get an idea of what sort of issues you're really encountering in this area.
카테고리
도움말 센터 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



