2015-01-22 6 views
1
음모를 꾸미고있는 동안 나는 shadedErrorBar을 사용하고

에 MATLAB 낮은 텍스트 해상도에서 글꼴 크기를 확대 + 통역, 및 코드의 부분을 읽라텍스 플롯

plot1 = shadedErrorBar(tau_vec, mean(deg_20_hubs_0), sd_deg_20_hubs_0, 'b-o', 1); hold on; 
plot2 = shadedErrorBar(tau_vec, mean(deg_20_hubs_1), sd_deg_20_hubs_1, 'r-o', 1); 
plot3 = shadedErrorBar(tau_vec, mean(deg_40_hubs_0), sd_deg_40_hubs_0, 'b-x', 1); 
plot4 = shadedErrorBar(tau_vec, mean(deg_40_hubs_1), sd_deg_40_hubs_1, 'r-x', 1); 
hold off; 
set(gca, 'FontSize', 15); 
xlabel('$\log_2 C_\tau$', 'Interpreter', 'latex'); ylabel('ExNVI'); 
xlim([-13, 13]); 
ylim([0, 1]); 

I=legend('$\bar{d}=20$; no hub ', '$\bar{d}=20$; with_hubs ', '$\bar{d}=40$; no hub ', '$\bar{d}=40$; with hubs ', ... 
'Location', 'SouthWest'); 
set(I, 'Interpreter', 'latex', 'fontsize', 15); 

if(off_diag==10 && N==500) 
    set(I, 'visible', 'on'); 
else 
    set(I, 'visible', 'off'); 
end 

box on; 
set(gca,'units','centimeters'); 
pos = get(gca,'Position'); 
ti = get(gca,'TightInset'); 

set(gcf, 'PaperUnits','centimeters'); 
set(gcf, 'PaperSize', [pos(3)+ti(1)+ti(3)+0.6 pos(4)+ti(2)+ti(4)+0.6]); 
set(gcf, 'PaperPositionMode', 'manual'); 
set(gcf, 'PaperPosition',[0 0 pos(3)+ti(1)+ti(3)+0.6 pos(4)+ti(2)+ti(4)+0.6]); 

saveas(fig, sprintf('./output/offdiag_%d_N_%d.pdf', off_diag, N)); 

결과 플롯이있다 다음과 같은 저해상도 텍스트 :

enter image description here 그러나 곡선의 해상도는 좋습니다. 라텍스 인터프리터를 제거 할 때 문제가 사라지 나 그것을 유지하고 해상도를 수정할 수 있습니까? 필자는 Windows에서 MATLAB 2014b로 그 줄거리를 작성했습니다.

감사합니다.

+0

비트 과잉을,하지만 난이 당신에게 적절한 솔루션을 제공 할 것을 확신합니다 : [언급되지 matlab-> export_fig] (HTTP를 : // undocumentedmatlab.com/blog/export_fig) –

답변

1
set(gcf, 'renderer','painters'); 

이 문제를 해결합니다. 그림을 벡터 그래픽으로 렌더링합니다. pdf 형식을 사용하고 있기 때문에 더 나은 선택입니다. 또한 saveas 대신 print 명령을 사용하여 해상도 지정 : 아마도

print(fig, '-dpdf', '-r600', 'myFigure.pdf') 
+0

작동하지 않는 경우 문제를 재현 할 수 있도록 예제 데이터로 질문을 편집하십시오. – thewaywewalk

+0

답변을 주셔서 감사합니다 @ thewaywewalk! 'painters' 렌더러는 shadedErrorBar 패키지에서는 작동하지 않지만 두번째 것은'print' 명령이 잘 작동합니다. – yuanz07