首页 > 编程知识 正文

matlab极坐标画操作,MATLAB画极坐标

时间:2023-05-06 11:19:58 阅读:200507 作者:2334

极坐标画图

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)这对那些质量要求不是很高的论文(图片)很省事。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。