matlab极坐标直线,[转载]如何在matlab中极坐标画图[通俗易懂]

matlab极坐标直线,[转载]如何在matlab中极坐标画图[通俗易懂]极坐标画图polar(phase,amp,”)-%%%%%%%%%%%%%%%%%%%%%%plotyourfigurebefore%%%%%%%%%…

大家好,欢迎来到IT知识分享网。

极坐标画图

polar(phase, amp, ‘ ‘)

———————————————————————————————————————–

%%%%%%%%%%%%%%%%%%%%%

%plot your figure before

%%%%%%%%%%%%%%%%%%%%%

% figure resize

set(gcf,’Position’,[100 100 260 220]);

set(gca,’Position’,[.13 .17 .80 .74]);

figure_FontSize=8;

set(get(gca,’XLabel’),’FontSize’,figure_FontSize,’Vertical’,’top’);

set(get(gca,’YLabel’),’FontSize’,figure_FontSize,’Vertical’,’middle’);

set(findobj(‘FontSize’,10),’FontSize’,figure_FontSize);

set(findobj(get(gca,’Children’),’LineWidth’,0.5),’LineWidth’,2);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%

解释:

set(gcf,’Position’,[100 100 260 220]);

这句是设置绘图的大小,不需要到word里再调整大小。我给的参数,图的大小是7cm

set(gca,’Position’,[.13 .17 .80 .74]);

这句是设置xy轴在图片中占的比例,可能需要自己微调。

figure_FontSize=8;

set(get(gca,’XLabel’),’FontSize’,figure_FontSize,’Vertical’,’top’);

set(get(gca,’YLabel’),’FontSize’,figure_FontSize,’Vertical’,’middle’);

set(findobj(‘FontSize’,10),’FontSize’,figure_FontSize);

这4句是将字体大小改为8号字,在小图里很清晰

set(findobj(get(gca,’Children’),’LineWidth’,0.5),’LineWidth’,2);

这句是将线宽改为2

plot(1:T, pos, ‘color’, [0 0 0], ‘LineWidth’,

2);

hold on;

plot(1:T, B(:, i), ‘color’, [0 1 0], ‘LineWidth’, 2);

plot(1:T, G(:, i), ‘color’, [0 0 1], ‘LineWidth’, 2);

plot(1:T, R(:, i), ‘color’, [1 0 0], ‘LineWidth’, 2);

xlabel(‘Time’);

ylabel(‘Position’);

axis([1 200 -0.05 0.15])

legend(‘True state’, ‘Bayes’, ‘Particle filter’, ‘Heddge filter’,

‘Location’,’NorthWest’);

images_fname = [folder ‘/images/’

sprintf(‘demo1_sigma_%.3f_rho_%.3f_alpha_%.3f.eps’,sigma_o, rho,

alpha)];

% print(‘-r80′,’-dpng’,images_fname);

set(gcf, ‘PaperPositionMode’, ‘manual’);

set(gcf, ‘PaperUnits’, ‘inches’);

set(gcf, ‘PaperPosition’, [0.25 2.5 8 4]);

% 输出大小由后面两个数确定,原来的输出大小是8 6

print(‘-r300’, ‘-depsc2’, images_fname);

再说下出图这个问题,我所用的软件是 Matlab,如果用matlab的同学可以参考一下:

(1)、质量要求高的(完美主义者)可以尝试 matlab2tikz,我对高质量的图是用这个方式。

(2)、质量要求不高的话,直接用 matlab 生成 eps 图片,然后通过 epspdf/ eps2pdf/ epstopdf

这些程序中的一种来将其转为 pdf 格式,(我平时用epspdf)这对那些质量要求不是很高的论文(图片)很省事。

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/24667.html

(0)

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

关注微信