Matlab刻画出漂亮的论文插图
figure(1);
c = contour(x,y,potential_value,15); %,15,‘ShowText’,‘off’ % 15 等高线的数量。
hold on;
x1 = [0:quiver_resolution:x_range];
y1 = [0:quiver_resolution:y_range];
[fx,fy]=gradient(quiver_value,-1,-1);
quiver(x1,y1,fx,fy,1.2); % X1,Y1为点的坐标。太密集也不好。 fx,fy 梯度值。 value 箭头的长度。
colormap jet;
colorbar(‘eastoutside’);
c = colorbar;
ax = gca;
axpos = ax.Position;
c.Position(2) = c.Position(3)+0.1;
c.Position(3) = 0.6c.Position(3);
c.Position(4) = 0.92c.Position(4);
ax.Position = axpos;
axis equal;
set(gcf,‘position’,[10,10, 880, 780]);
xticks(0:50:100);
yticks(0:50:100);
set(gca,‘FontName’,‘Times New Roman’,‘FontSize’,32);
pos=axis; %取得当前坐标轴的范围,即[xmin xmax ymin ymax]
% xlabel(‘x轴’,‘position’,[pos(2) 1.15*pos(3)]);
xlabel(’\it\fontname{Times New Roman}x\rm(m)’,‘position’,[0.5pos(2) pos(1)-8],‘FontSize’,32);
ylabel(’\it\fontname{Times New Roman}y\rm(m)’,‘position’,[pos(1)-10 0.5pos(2)],‘FontSize’,32);
A=getframe(gcf);
imwrite(A.cdata,‘try.png’) %存储调整过大小的图片
% set(get(gca,‘XLabel’),‘FontSize’,figure_FontSize,‘Vertical’,‘top’);
% set(get(gca,‘YLabel’),‘FontSize’,figure_FontSize,‘Vertical’,‘middle’);