Matlab 在极轴等高线图上添加网格线

Matlab 在极轴等高线图上添加网格线,matlab,matlab-figure,polar-coordinates,contourf,Matlab,Matlab Figure,Polar Coordinates,Contourf,我有下面的代码生成下面的图像 如何添加极轴网格线?我想加上100、200、300和400。请注意,半径为400。这看起来可能不是最好的,但我想补充一下。如果这是可能的,也许有人可以建议另一个颜色图,可能看起来更好 您可以使用polaraxes将另一个axes添加到您的体形中,并在其上放置网格,如下例所示: [X,Y,Z] = peaks; [~,h] = contour(X,Y,Z,20); axis off axis equal % this is important for the pol

我有下面的代码生成下面的图像

如何添加极轴网格线?我想加上100、200、300和400。请注意,半径为400。这看起来可能不是最好的,但我想补充一下。如果这是可能的,也许有人可以建议另一个颜色图,可能看起来更好


您可以使用
polaraxes
将另一个
axes
添加到您的体形中,并在其上放置网格,如下例所示:

[X,Y,Z] = peaks;
[~,h] = contour(X,Y,Z,20);
axis off
axis equal % this is important for the polar axes to fit the catresian axes
           % when resizing the figure
colorbar;
% get the contour position after adding the colorbar:
cont_pos = h.Parent.Position;
% place a transparent polar axes on top of the contour:
polaraxes(gcf,'Position',cont_pos,'Color','none','Rlim',[0 400]);

因此,您只需在代码末尾添加以下内容:

axis equal
% get the contour position after adding the colorbar:
cont_pos = get(gca,'Position');
% place a transparent polar axes on top of the contour:
polaraxes(gcf,'Position',cont_pos,'Color','none','Rlim',[0 400]);

您可以查看可用颜色贴图的列表,并选择您喜欢的颜色。

您能更具体一点吗?有没有办法在matlab中添加网格线?
axis equal
% get the contour position after adding the colorbar:
cont_pos = get(gca,'Position');
% place a transparent polar axes on top of the contour:
polaraxes(gcf,'Position',cont_pos,'Color','none','Rlim',[0 400]);