all values ​​on the surf chart

2 次查看(过去 30 天)
Lev Mihailov
Lev Mihailov 2019-11-22
编辑: Adam Danz 2020-1-21
1.pngI create a graph of surf (X, Y, Z, C), when I click on the graph, I will get X, Y, Z. Is there any way to get C to display ?
  1 个评论
Adam Danz
Adam Danz 2019-11-24
编辑:Adam Danz 2020-1-21
@ Lev Mihailov, if answers to your questions are helpful, accept the answer so others know it worked for you. Volunteers appreciate that feedback.

请先登录,再进行评论。

回答(1 个)

Adam Danz
Adam Danz 2019-11-22
编辑:Adam Danz 2019-11-22
Here's a demo
[X,Y] = meshgrid(1:0.5:10,1:20);
Z = sin(X) + cos(Y);
s = surf(X,Y,Z);
row = dataTipTextRow('C',s.CData); % define new row to datatip
s.DataTipTemplate.DataTipRows(end+1) = row; % add new row to datatip
For more info:

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by