Limits of polar plots axes

8 ビュー (過去 30 日間)
alberto tonizzo
alberto tonizzo 2023 年 1 月 30 日
コメント済み: Walter Roberson 2023 年 1 月 31 日
Hello, please see the code atatched that makes a polar plot and adds transparency to it with the included (in the body) function "updateTransparency". The mat file to load is also attached (i.e. 'PolarPlotIssue_v1.mat').
The problem is that if lines 6-8 are commented out (if excluding angles large than 40 degrees), the polar plot becomes very small, i.e. it's not scaled.
How do I make the polar plot as large as the original (when lines 6-8 are NOT commented out)?
THANK YOU!

採用された回答

Walter Roberson
Walter Roberson 2023 年 1 月 31 日
You are using polar() which is the older function that uses cartesian axes. It is difficult to customize.
We would normally recommend that you switch to polarplot() but I see that you have hold on and overlay a semi-transparent contourf() which is based on cartesian coordinates.
the = linspace(0,2*pi);
r = the.^2 - cos(the);
h = polar(the,r);
findall(h.Parent)
ans =
33×1 graphics array: Axes Line Text (0) Text (180) Text (330) Text (150) Text (300) Text (120) Text (270) Text (90) Text (240) Text (60) Text (210) Text (30) Line Line Line Line Line Line Text ( 40) Line Text ( 30) Line Text ( 20) Line Text ( 10) Line Patch Text Text Text Text
You can see that the older polar() throws up a bunch of text objects for labels, and draws a bunch of line() for the spokes and radii. There are no internal controls for polar() that limit angles.
  2 件のコメント
alberto tonizzo
alberto tonizzo 2023 年 1 月 31 日
@Walter Roberson do you know how to use contourf() with polarplot()?
Or is there another way to create polar plots in Matlab?
Thanks
Walter Roberson
Walter Roberson 2023 年 1 月 31 日
contourf cannot be used with polarplot()
You would have to extract the contour boundaries and convert them to polar coordinates and polarplot those. But angles would very likely go out of range.
It would perhaps be easier to create a second axes in the same position as the first, with axes background color 'none' and possibly using alpha (transparency).
I do not know at the moment whether it is possible to use yyaxis between numeric axes and a polar axes. I would tend to suspect not.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by