Making a 2d polar plot with color

4 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Contour Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by