Matlab图中的标签文本模糊 [英] Blurry label text in matlab plots

查看:463
本文介绍了Matlab图中的标签文本模糊的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些matlab图.当我保存图并将其放入我的Word文档中,然后将其另存为pdf文件时.我的图标签模糊了,有些字母不清楚?!

I'm having some matlab plots. when I save the plot and then put it in my word document and then save it as pdf file. I get the plot labels blurry and some letters is unclear ?!

plot(d1,S,'*');
title('Frequency','FontWeight','bold','FontSize',11);
xlabel('delta','FontWeight','bold','FontSize',11), ylabel('sigma','FontWeight','bold','FontSize',11);

为什么会这样(生气)? 我该如何解决?!

why does that happened (got angry)?! how can I fix it ?!

推荐答案

网络上对此有很多讨论,但是当我想将图形导出到图像时,没有一种解决方案真正令我满意. 无论如何,这就是我所做的:

There are many discussions about this on the web, but non of the solutions actually satisfied me when I wanted to export a graph to an image. Anyway here is what I've done:

MyFont = {'FontName', 'Times New Roman', 'FontSize', 25};
graph_size = [1200 800]; % in pixels

fig_h = figure('Units', 'pixels', 'Position', [10 50 graph_size]);

% Do your plot
x = 0:0.1:2*pi;
plot(x, sin(x))

set(gca, MyFont{:}); % Adjust all the font sizes in the axes

现在,您可以使用 print (如@Amro所说):

Now you can copy a vector-based version (which is nicest quality as @wakjah mentioned) to clipboard with print (as @Amro said):

print -dmeta

或使用 hgexport 导出到metafile再次:

hgexport(figH,'-clipboard')

但是,您需要手动调整MyFont中的graph_size和FontSize以获得所需的输出.但是,好处是,如果您要为某些出版物使用它,则只需要做一次.

However you need to adjust the graph_size and FontSize in MyFont manually to get your desired output. But the good thing is that if you want it for some publication you just need to do it once.

请注意,尽管您将图形导出为基于矢量的格式,但是如果放大图形线,图形线看起来仍然会断裂,但它们不会模糊.这就是为什么您可能想增加屏幕上图形的大小(graph_size,因此是FontSize)以得到更准确的图形的原因.

Please note that although you are exporting the graphs as a vector-based format but your graph lines would still seem fractured if you zoom on them but they are not blurry. This is why you might want to increase the size of your graph on screen (graph_size and consequently the FontSize) to have a more accurate graph.

希望这会有所帮助.

相关帖子:

MATLAB:打印pdf格式的图,如MATLAB中显示的图

In matlab, how do you save a figure as an image in the same way as using "Save As..." in the figure window?

这篇关于Matlab图中的标签文本模糊的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆