2013-01-17 49 views
1

我出奇無法確定我到底如何改變蜱和/或極座標圖的徑向線的顏色,見下圖:在MATLAB中改變極座標刻度線/徑向線的顏色?

enter image description here

很簡單,我想改變你在這裏看到的徑向虛線的顏色,也就是說,藍色或其他東西。我還想改變數字的顏色和你在這裏看到的邊緣,紅色。這怎麼可能?

回答

4

在這個鏈接http://www.mathworks.com/matlabcentral/answers/67他們展示瞭如何刪除極座標圖中的每一個網格線。

我認爲你可以嘗試類似的東西,但相反,刪除你只會改變顏色。

我實現與下面的代碼的結果:

p = polar(1); % plot a circle with radius = 1; 
h = findall(gcf, 'type', 'line'); % find all lines in the current figure 
h(h==p) = []; % remove the line you ploted from the list. 
set(h, 'Color', 'g'); % make all of them green 
T = findall(gcf, 'type', 'text'); % find all text 
set(T, 'Color', 'r'); % change its color 

通知,它改變每一行是不是你ploted所述一個(在該例子僅隨r的圓= 1保持不變)的顏色。如果您只需要更改網格,則需要優化由「findall」函數進行的搜索。有關它的更多信息,請參閱「doc findall」。

+0

奇妙的我認爲這會奏效 - 最後一件事情,你如何改變數字的顏色?謝謝! – Spacey

+0

@Learnaholic我將它添加到答案中的代碼中。 – Mikhail