How to plot a polar plot with different colors or how to overlay the plots?

4 ビュー (過去 30 日間)
Marcelina Król
Marcelina Król 2021 年 4 月 2 日
回答済み: Star Strider 2021 年 4 月 2 日
I have to have different colour for negative values and another one for positive values on the polar plot. The second option is to overlay two plots: one with negative and the other with positive values. My data is read from excel. I am adding a photo of a plot "Okres 3" to help you to see what it looks like. I would really apreciate your help. :)

回答 (1 件)

Star Strider
Star Strider 2021 年 4 月 2 日
Try something like this:
a = linspace(0, 2*pi); % Create Data
r = sin(a) + cos(2*a); % Create Data
ispos = r>0; % Positive ‘r’ Values = ‘true’
figure
polarplot(a(ispos), r(ispos), '-r')
hold on
polarplot(a(~ispos), r(~ispos), '-g')
hold off
.

カテゴリ

Help Center および File ExchangePolar Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by