Switch colormap targeted axis
3 次查看(过去 30 天)
显示 更早的评论
Hi,
It is super easy to switch the axis while using a "surf / mesh like function" (simply by switching the X,Y,Z order in surf(X,Y,Z) )
However, when adding a colormap I didn't find anywhere how to also switch the colormap targeted axis. Meaning if I write surf(Z,Y,X), the colormap will target the third element, which is X here, not Z axis, the one I would like for the same rendering.
Do you have any idea of how I could do this ?
Thank you
Nicolas
Edit : for example with this code :
[X,Y,Z] = peaks(64);
surf(Z,X,Y);
I would like of course the colormap to be in the depth direction.
1 个评论
Adam
2020-2-4
Use the 4th argument to surf and pass in whichever variable you wish to use again, e.g.
surf( Z, X, Y, Z )
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!