Mathematica 列表轮廓图3D

发布于 2024-08-26 08:17:35 字数 642 浏览 2 评论 0原文

我的数据格式为 { {x,y,z,f}...} 我正在使用 ListContourPlot3D 但我得到的只是一个尺寸为 -1 的空框每个方向都为 1。这是我的代码:

ListContourPlot3D[data5, PlotRange -> All, 
  AxesLabel -> {"[Beta]", "[Omega]", "Vo"}, Contours -> {1500}].

这些是我的数据的前 5 个点:(整个集合有 55 个点)

{{200, 20000 10^(1/3), 2000, 1226}, 
 {200, 20000 10^(1/3), 2600, 1422}, 
 {200, 20000 10^(1/3), 3200, 1581}, 
 {200, 20000 10^(1/3), 3800, 1761}, 
 {200, 20000 10^(1/3), 4400, 1872}}

Dimensions[data5] 返回 {55,4} 如果我执行 IntegerPart[data5] ,它会正确执行,因此它必须识别我的数据中的数字。

我很欣赏任何想法。 谢谢。

I have data in the form { {x,y,z,f}...} I am using ListContourPlot3D but all I get is an empty box with dimensions -1 to 1 in each direction. Here is my code:

ListContourPlot3D[data5, PlotRange -> All, 
  AxesLabel -> {"[Beta]", "[Omega]", "Vo"}, Contours -> {1500}].

These are the first 5 points of my data:( the whole set has 55 points)

{{200, 20000 10^(1/3), 2000, 1226}, 
 {200, 20000 10^(1/3), 2600, 1422}, 
 {200, 20000 10^(1/3), 3200, 1581}, 
 {200, 20000 10^(1/3), 3800, 1761}, 
 {200, 20000 10^(1/3), 4400, 1872}}

Dimensions[data5] returns {55,4}
If I do IntegerPart[data5] it does it correctly so it must recognize the numbers in my data.

I appreciate any ideas.
Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

吝吻 2024-09-02 08:17:35

如果没有整个数据集,很难判断,但我敢打赌你的轮廓有问题 -> {1500} 设置。如果完全省略它或使用不同的值会发生什么?

It's hard to tell without having the entire dataset, but I am betting there is a problem with your Contours -> {1500} setting. What happens if you omit it altogether or use a different value?

牵你的手,一向走下去 2024-09-02 08:17:35

轮廓 ->编号
绘制 num 个等距的水平轮廓。
轮廓 -> {编号}
绘制 f[x,y,z] = num 轮廓。

你指的是前者吗?如果数据太稀疏或本地化,我怀疑 ListContourPlot3D 能否绘制数据。对于您提供给我们的数据样本,x 和 y 根本没有变化。最终数据集中的 x 和 y 变化是否足以很好地填充坐标空间?

Contours -> num
Plots num equally spaced levels contours.
Contours -> {num}
Plots the f[x,y,z] = num contour.

Did you mean the former? I doubt ListContourPlot3D can plot your data if it is too sparse or to localized. For the data sample you gave us x and y do not vary at all. Does x and y vary enough in you final data set to well populate coordinate space?

杯别 2024-09-02 08:17:35

@Davorak's 建议数据集,如所写,似乎没有变化可能是原因的问题。假设情况并非如此,请尝试旋转生成的图形,如果您看到出现黑色平面,则说明配色方案已关闭。默认情况下,ListContourPlot3D 会生成不透明的白色表面,但我遇到过这样的问题:它似乎没有生成任何东西,但它只是不可见。解决方案:添加一个 ContourStyle 选项,并将其设置为 Red 之类的内容。

@Davorak's suggestion that the data set, as written, does not seem to vary may be the cause of the problem. Assuming that is not the case, try rotating the resulting graphic, and if you see a black plane appear, then it is the color scheme that is off. By default, ListContourPlot3D produces an opaque white surface, and I've had issues where it did not seem to produce anything, but it was just invisible. The solution: add a ContourStyle option, and set it to something like Red.

童话里做英雄 2024-09-02 08:17:35

问题在于以低分辨率使用 ListContourPlot3D 的 {x,y,z,f} 形式。
几周前我也偶然发现了这个问题,这是该错误的一个最小示例:

xyzfdata[r_] := Flatten[#, 2] &@Table[{x, y, z, x^2 + y^2 + z^2 - 1}, 
  {x, -2, 2, r}, {y, -2, 2, r}, {z, -2, 2, r}];
(* Low resolution {x,y,z,f} fails *) 
ListContourPlot3D[xyzfdata[1], Contours -> {0}]

我的案例(我的数据位于网格上)的解决方案是使用网格表单和 DataRange:

fdata[r_] := Table[x^2 + y^2 + z^2 - 1, 
  {z, -2, 2, r}, {y, -2, 2, r}, {x, -2, 2, r}];
(* Low resolution works ok for array data *)
ListContourPlot3D[fdata[1], Contours -> {0}, 
  DataRange -> 2 {{-1, 1}, {-1, 1}, {-1, 1}}]

我认为问题在于,对于 {x,y,z,f} 形式,实现使用插值的方式在低分辨率下失败。提高第一个示例中的分辨率,一切正常:

(* Higher resolution {x,y,z,f} works *)
ListContourPlot3D[xyzfdata[.2], Contours -> {0}]

The problem is using the {x,y,z,f} form of ListContourPlot3D at low resolution.
I stumbled over this a few weeks ago as well, here is a minimal example of the bug:

xyzfdata[r_] := Flatten[#, 2] &@Table[{x, y, z, x^2 + y^2 + z^2 - 1}, 
  {x, -2, 2, r}, {y, -2, 2, r}, {z, -2, 2, r}];
(* Low resolution {x,y,z,f} fails *) 
ListContourPlot3D[xyzfdata[1], Contours -> {0}]

The solution in my case (I had my data on a grid) was to use the grid form and DataRange:

fdata[r_] := Table[x^2 + y^2 + z^2 - 1, 
  {z, -2, 2, r}, {y, -2, 2, r}, {x, -2, 2, r}];
(* Low resolution works ok for array data *)
ListContourPlot3D[fdata[1], Contours -> {0}, 
  DataRange -> 2 {{-1, 1}, {-1, 1}, {-1, 1}}]

I think the issue is that for the {x,y,z,f} form, the implementation uses interpolation in a way that fails at low resolution. Upping the resolution in the first example, everything works:

(* Higher resolution {x,y,z,f} works *)
ListContourPlot3D[xyzfdata[.2], Contours -> {0}]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文