Combination of surf and scatter plot
38 ビュー (過去 30 日間)
古いコメントを表示
Hello, I would like to combine a surf and a scatter (initially contour) plot. However, I discovered that these types of plot do interact with each other, so that the plot of one type changes the color of the other. Here is an example:
n = 50;
q = linspace(-3, 3, n);
[X, Y] = meshgrid(q);
Z = peaks(X, Y);
figure(1);
surf(X, Y, Z);
hold on;
scatter3(X(:), Y(:), -10*ones(n*n, 1), [], Z(:)/10);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/291135/image.jpeg)
Does someone know how to fix this issue?
4 件のコメント
ChrizzzlP
2020 年 5 月 7 日
check the part about supplying a target, so you can set 2 different colormaps for the different parts by supplying their handle (e.g. the h you named your surface plot).
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Scatter Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!