Tuesday 15 July 2014

graphics - Quality of graph, matlab -



graphics - Quality of graph, matlab -

here code plotting cos(x) , (sinx)

t = -pi:0.01:(pi); x = cos(t); y = sin(t); h1=plot(t,x,'b', 'markersize', msz); hold on; h2=plot(t,y,'r', 'markersize', msz); alw = 0.75; % axeslinewidth fsz = 11; % fontsize lw = 1.5; % linewidth msz = 8; % markersize pos = get(gcf, 'position'); set(h1,'linewidth',lw) % axis([-pi pi -1 1]) set(gcf, 'position', [pos(1) pos(2) width*100, height*100]); %<- set size set(gca, 'fontsize', fsz, 'linewidth', alw); %<- set properties legend('cos(t)','sin(t)','location','northwest') title('plot of cos(x) , sin(x) between -2\pi , 2\pi') set(gca,'xtick',-pi:pi/2:pi) set(gca,'xticklabels',{'-\pi','-\pi/2','0','\pi/2','\pi'})

although works fine, not satisfied quality of produced plot. lines in plot appear inconsistent of poor quality.

how can matlab create image quality similar this:

if want really nice plots, recommend matlab2tikz.

i used in thesis , looks beautiful. script converts matlab figure tikz/pgfplot file. can include in latex document. or utilize latex create pdf file.

i know, can export pdf straight matlab. while can increment line etc., still falls short of tikz outstanding quality.

matlab graphics plot

No comments:

Post a Comment