plot ontop of 3d scatter plot

3 ビュー (過去 30 日間)
Maximilian Dio
Maximilian Dio 2021 年 9 月 24 日
回答済み: Sivani Pentapati 2021 年 9 月 30 日
Hello I want to plot a curve in 3d in a scatter plot which fills the same space. One can not see the curve well because it is always obsured by the scatter plot. how can I make the curve always on top / not obscured by the 3d scatter plot anymore. should I use 2 axes??
Thanks in advance

回答 (1 件)

Sivani Pentapati
Sivani Pentapati 2021 年 9 月 30 日
Based on my understanding, you want the curve to be on top of the scatter plot. This can be done using hold on with scatter plot followed by the plot of the curve. Please refer to the below example code. You can also refer to documentation of hold on for more information
figure
[X,Y,Z] = sphere(16);
x = [0.5*X(:); 0.75*X(:); X(:)];
y = [0.5*Y(:); 0.75*Y(:); Y(:)];
z = [0.5*Z(:); 0.75*Z(:); Z(:)];
scatter3(x,y,z)
hold on
[X,Y] = meshgrid(-5:0.5:5,-5:0.5:5);
Z = sin(X) + cos(Y);
surf(X,Y,Z)

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by