Data cursor showing color value
显示 更早的评论
Is there a way to get the data cursor to list the X,Y,Z coordinates and the value from the colorbar in a 3d scatter plot with the dots colored by a 4th column vector?
the default data cursor gives only X,Y,Z.
thanks Greg
采纳的回答
更多回答(1 个)
Gregory McFadden
2016-9-27
1 个投票
1 个评论
Michael Abboud
2016-9-27
If you are using a version of MATLAB such as R2014a or earlier, then graphics generally work a bit differently from newer releases. You can refer to the following link for more information about the graphics changes in MATLAB R2014b:
-
If your version of MATLAB is pre-R2014b, try replacing the terms such as “event_obj.Target.XData” with the following:
>> get( get(event_obj, 'Target'), 'XData')
And then replace the specific line:
>> value = event_obj.Target.CData(idx(1));
With the following:
>> CData = get( get(event_obj, 'Target'), 'CData');
>> value = CData(idx(1));
Also note that I am using an example from the "scatter3" documentation page to test my solution. Perhaps see if you can get it working with the 3rd example, "Vary Marker Color", and then generalize to your own code. You can find the "scatter3" documentation page below:
类别
在 帮助中心 和 File Exchange 中查找有关 Scatter Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!