Making a 2d polar plot with color

4 ビュー (過去 30 日間)
Benjamin Cowen
Benjamin Cowen 2017 年 5 月 25 日
回答済み: Star Strider 2017 年 5 月 27 日
Hi I was able to create a contour polar plot using:
https://www.mathworks.com/matlabcentral/fileexchange/14826-polar-contour-plot
I have questions about my attachment picture:
How can I add gridlines?

採用された回答

Star Strider
Star Strider 2017 年 5 月 27 日
I didn’t see your Question before.
I would run the grid-creating plot calls adding a ‘z’ value of zeros to work with your polar contour plot:
plot3(cc50(1,:), cc50(2,:), zeros(size(cc50(1,:))), 'k') % Plot Full Circumference
plot3(cc30(1,:), cc30(2,:), zeros(size(cc30(1,:))), 'k')
plot3(cc10(1,:), cc10(2,:), zeros(size(cc10(1,:))), 'k')
plot3(rdx, rdy, zeros(size(rdx)), 'k') % Plot Radials
I have tested this, and it works as I want it to. I have not tested it with your code. It should work. For a 3D plot, the grids have to be specified as 3D objects themselves, and setting the ‘z’ values to zero does that. If you want the grids to be at a ‘z’ value other than zero, add the same scalar value to the zeros call.
Example:
kz = 20;
figure(1)
plot3(cc50(1,:), cc50(2,:), zeros(size(cc50(1,:)))+kz, 'k') % Plot Full Circumference
hold on
plot3(cc30(1,:), cc30(2,:), zeros(size(cc30(1,:)))+kz, 'k')
plot3(cc10(1,:), cc10(2,:), zeros(size(cc10(1,:)))+kz, 'k')
plot3(rdx, rdy, zeros(size(rdx))+kz, 'k') % Plot Radials
hold off
axis equal
grid on
axis([-50 50 -50 50 0 25])
I am plotting this in the context of my previous code, using the calculations from it for the ‘cc’ and ‘rd’ variables.

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by