Sparse mesh on a surface plot with dense sampling

8 ビュー (過去 30 日間)
Nick Kyparissas
Nick Kyparissas 2022 年 11 月 3 日
コメント済み: Nick Kyparissas 2022 年 11 月 3 日
Hi everyone!
At the surface plot example of Matlab, we have the following commands:
[X,Y,Z] = peaks(25);
CO(:,:,1) = zeros(25); % red
CO(:,:,2) = ones(25).*linspace(0.5,0.6,25); % green
CO(:,:,3) = ones(25).*linspace(0,1,25); % blue
surf(X,Y,Z,CO)
which produce the following figure:
If we increase the number of samples from 25 to 100, the mesh grid of the surface becomes denser:
Is there an easy way to have the smoothness of the secone one, with the grid of the first one? For example to show every N-th line (here, for example, 100/25 = 4, so every 4th line)?
Plotting the sparse mesh grid over a mesh-free surface won't help me, I want to be able to do this through the properties of the generated figure, as I want to be able to do this for figures produced by apps like the Curve Fitting app etc.
Thank you for your time!

採用された回答

Matt J
Matt J 2022 年 11 月 3 日
編集済み: Matt J 2022 年 11 月 3 日
Plotting the sparse mesh grid over a mesh-free surface won't help me, I want to be able to do this through the properties of the generated figure, as I want to be able to do this for figures produced by apps like the Curve Fitting app etc.
That doesn't rule out overlaying 2 surface plots. All apps that I an think of allow you to export the results in code form, which you can then modify. You are never stuck with just a plot.
Otherwise, no, it's not possible. If you find the dense grid lines obtrusive, you could get rid of them, or make them more transparent:
[X,Y,Z] = peaks(100);
CO(:,:,1) = zeros(100); % red
CO(:,:,2) = ones(100).*linspace(0.5,0.6,100); % green
CO(:,:,3) = ones(100).*linspace(0,1,100); % blue
surf(X,Y,Z,CO,'EdgeAlpha',0.3)
  1 件のコメント
Nick Kyparissas
Nick Kyparissas 2022 年 11 月 3 日
Ah, I understand, thank you for your answer and the proposed solution!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by