【问题标题】:Matlab Polarplot() and surface colorMatlab Polarplot()和表面颜色
【发布时间】:2018-11-22 10:10:19
【问题描述】:

我对我的极地情节有点挣扎。我正在玩罢工和下跌,对于每一对,一个“强度”。我想在我的极坐标图上绘制这个表面/轮廓/任何函数。我找不到这样做的句柄。 Dpp2 包含给定 theta 和 rho/strike 和 dip 的强度值。

xTmp = (0:4:360);
yTmp = (0:22.5:90);

[strike,dip]= meshgrid(deg2rad(xTmp),deg2rad(yTmp));

dip2 = rad2deg(dip);
strike2 =rad2deg(strike);

figure('name', 'COLD');
polarplot([0 360],[0 90]);

s = surf(strike2, dip2, DPp2);

polarplot(s);
colormap

我尝试过类似的方法,但显然行不通。

干杯, 弗洛尔

【问题讨论】:

  • 未定义的函数或变量 DPp2。我们无法运行您的示例代码。

标签: matlab plot colormap polar-coordinates


【解决方案1】:

据我所知,没有办法直接在极坐标图中创建曲面图。

一种解决方法是手动创建极轴图。你可以找到一个例子here

另一种解决方法是使用 polarscatter 创建一个散点图(如果你有一个紧密的网格,看起来很相似)看看this

因为您提到了句柄:如果您想要轴的句柄,请查看 here 中的 polaraxes

【讨论】:

  • 感谢您的快速回答。我会尝试分散解决方案并回复您
【解决方案2】:

极地散射不起作用,所以我尝试了另一个功能,根据此页面似乎可以工作:https://fr.mathworks.com/matlabcentral/answers/95796-how-do-i-create-a-contour-plot-in-polar-coordinates

我注意到那里还没有,等高线图没有“包裹”在我的极坐标图周围,但到目前为止它正在编译。如果有人知道如何将等高线图叠加到极坐标图上?

dip2 = rad2deg(dip);
strike2 =rad2deg(strike);


h = polar([0 360],[0 90]);
hold on;
contourf(strike2,dip2,DPp2);
% Hide the POLAR function data and leave annotations
set(h,'Visible','off')
% Turn off axes and set square aspect ratio
axis off
axis image

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-11
    • 2023-03-30
    • 2011-11-29
    • 2014-01-03
    • 1970-01-01
    相关资源
    最近更新 更多