Hello,
I have plot a 3d figure. But the height on the z-axis looks like a flat 2d surface.
How can I plot the height and makes the height displays like a 3d surface.
Many thanks!

4 件のコメント

Walter Roberson
Walter Roberson 2021 年 1 月 6 日
Change the zlim(). If you are hard-coding the zlim now, then let MATLAB figure it out for itself.
Alan
Alan 2021 年 1 月 6 日
Thanks. I know change the zlim( ) makes my plot a little more 3d like. The question is I want to draw the plot like the below example, in the sample plot, the height is displayed by 3d surface and their height is randomly distributed. But my plot, the height is just displayed by the same color points.
VBBV
VBBV 2021 年 1 月 6 日
編集済み: VBBV 2021 年 1 月 6 日
May be you're equations for Z axis produces flatter surfaces. Or try with varied xlim and ylim range values in meshgrid generation for surf plot
Alan
Alan 2021 年 1 月 6 日
Thanks. The surf plot is what I want to realize.

サインインしてコメントする。

 採用された回答

Star Strider
Star Strider 2021 年 1 月 6 日

1 投票

It depends what your data are.
If you are currently using scatter3 or plot3, and your data are reasonably ordered, instead use surf.
If your data are random, create a surface using griddata (or similar functions) to interpolate your point data to a surface that surf can use.

2 件のコメント

Alan
Alan 2021 年 1 月 6 日
Thank you. The surf function works here.
Star Strider
Star Strider 2021 年 1 月 6 日
My pleasure!
If my Answer helped you solve your problem, please Accept it!
Also, although I wrote ‘random’ I meant ‘scattered’ .

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

質問済み:

2021 年 1 月 6 日

編集済み:

2021 年 1 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by