I get bad resolution when saving my plot with filled circles as .pdf or .eps

5 ビュー (過去 30 日間)
Gunnar
Gunnar 2014 年 8 月 16 日
コメント済み: Ben11 2014 年 8 月 17 日
Even though the plot looks okay when shown in MATLAB, the filled circles seem to lose their resolution when I save them. To see the difference, please open the saved PDF or EPS file. Thank you for your advice.
The code:
clear all, close all
sysX = 30; sysY = 30;
xyb = [5 +1j*5 , 5+1j*15 , 5+1j*25, ...
15+1j*5 , 15+1j*15 , 15+1j*25, ...
25+1j*5 , 25+1j*15 , 25+1j*25];
xym = sysX*rand(1,18);
fig = 0;
fig = fig + 1; figure(fig);
for i = 1:length(xyb),
plot(xyb(i),'ko'), axis([0 sysX 0 sysY]), hold on
plot(xym,'ko','MarkerSize',4,'MarkerFaceColor','k')
end
xlabel('Unit 1');
ylabel('Unit 2');
legend('Type 1','Type 2','Location','North','Orientation','Horizontal');
set(gca,'Units','pixels');
filenameStrEps = 'testFigure.eps';
filenameStrPdf = 'testFigure.pdf';
saveas(gcf,filenameStrEps)
saveas(gcf,filenameStrPdf)

回答 (1 件)

Ben11
Ben11 2014 年 8 月 16 日
You might want to use print instead of save, and set the resolution to something acceptable to you:
print(gcf, '-dpdf', '-r600', filenameStrPdf)
  2 件のコメント
Gunnar
Gunnar 2014 年 8 月 16 日
編集済み: Gunnar 2014 年 8 月 16 日
Thank you for your answer, Ben. However, I only see a marginal improvement for the PDF. In the case of EPS, it seems to have a much more positive effect.
Ben11
Ben11 2014 年 8 月 17 日
ok then sorry!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by