【问题标题】:Matlab or Origin - Combining two sets of 3D data in one contour plotMatlab 或 Origin - 在一个等高线图中组合两组 3D 数据
【发布时间】:2017-07-26 19:17:30
【问题描述】:

我有两组带有 XYZ 坐标的 3D 数据。我想知道是否有可以将两者结合的程序,例如:

一组数据由绘图的颜色表示,另一组数据由绘图的高度(3D)表示。

我熟悉 Matlab 和 Origin。

【问题讨论】:

  • 是的,你可以。了解自定义颜色图

标签: matlab plot 3d contour originlab


【解决方案1】:

可以通过surf(Z,C)完成。

a = randi(20,20,20);
b = randi(20,20,20);

figure;
subplot(2,2,1);
surf(a);
title('Height');

subplot(2,2,2);
surf(b);
title('Color');

subplot(2,2,[3,4]);
surf(a,b);
title('Mixed');

不是最好的表示,但您可以看到一个矩阵产生高度,一个产生颜色。

混合图的颜色来自右图

混合地块的高度来自左边地块

【讨论】:

    【解决方案2】:

    如果你使用 scatter3 函数很容易。

    w=100;
    x1=rand(1,w);
    y1=rand(1,w);
    z1=rand(1,w)*100;
    z2=ceil(rand(1,w)*255);
    figure
    h=scatter3(x1,y1,z1,ones(1,w)*50,z2,'filled');
    

    【讨论】:

      猜你喜欢
      • 2022-01-12
      • 2022-10-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-21
      • 2020-05-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多