2017-05-26 11 views
2

次の画像を生成する次のコードがあります。 Polar Contour極軌道プロットへのグリッド線の追加

極性グリッド線はどのように追加できますか?私は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

具体的にお答えください。 matlab内にグリッド線を追加する方法はありますか? – Jack

答えて

1

あなたはあなたの姿に別のaxesを追加し、以下の例のように、それらの上にグリッドを配置するpolaraxesを使用することができます。

[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]); 

polar contour

だから、コードの最後にこれを追加するだけです:

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利用可能なカラーマップの一覧を表示し、好きなものを選択できます。

関連する問題