如何添加极地网格线?我想添加100,200,300和400.请注意半径为400.它可能看起来不是最好,但我想添加它们。也许如果这是可能的,有人可能会建议另一个可能看起来更好的色彩图。
The function polarcont
in FileExchange
close all
data1 = xlsread('C:\carbon.xlsx','Sheet4');
data2 = xlsread('C:\carbon.xlsx','Sheet2');
data3 = xlsread('C:\carbon.xlsx','Sheet3');
t = data1(1,:);
r = data2(:,1);
z = data3(:,:);
figure(1)
polarcont(r,t,z)
myColorMap = colormap;
myColorMap(1,:) = [1 1 1];
colormap(myColorMap);
colorbar;
beta = 0.9;
brighten(beta)
axis off
答案 0 :(得分:1)
您可以使用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]);
您可以看到here可用色彩映射列表,并选择您喜欢的颜色。