admin 管理员组文章数量: 1086019
2024年3月8日发(作者:永磁同步异步电机区别)
极坐标画图
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_%.',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)这对那些质量要求不是很高的论文(图片)很省事。
版权声明:本文标题:MATLAB极坐标画图-精彩例子 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1709882192a548567.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论