Depth Label of 3D Graph (Cylinder)
1 回表示 (過去 30 日間)
古いコメントを表示
I'm trying to graph a borehole using a set of depths and their respective diameters. I tried graphing it using:
r = [5,7,4,6,8,6,5,5,7,8]; [X,Y,Z]=cylinder(r); Surf(X,Y,X)
Which gave me a graph showing the diameters "r" on the x-y plane, but the z axis is always set to 1 (endpoints 0 to 1). How can I assign depths to each diameter of the graph.
e.g. (Z = [0,1,2,3,4,5,6,7,8,9])
0 件のコメント
回答 (1 件)
Benjamin Kraus
2018 年 2 月 1 日
I would recommend ignoring the Z output from cylinder and just creating your own using meshgrid or ndgrid.
r = [5,7,4,6,8,6,5,5,7,8];
depths = [0,1,2,3,4,5,6,7,8,9];
[X,Y]=cylinder(r');
[~,Z] = meshgrid(1:size(X,2),depths);
[~,C] = meshgrid(1:size(X,2),r); % Color based on radius
surf(X,Y,Z,C)
If the data is upside down, just flip depths before calling meshgrid:
r = [5,7,4,6,8,6,5,5,7,8];
depths = [0,1,2,3,4,5,6,7,8,9];
[X,Y]=cylinder(r');
[~,Z] = meshgrid(1:size(X,2),flip(depths));
surf(X,Y,Z)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Graph and Network Algorithms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!