How to add a data cursor to a 3d surface which only shows the 'Z-value'?
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
Hi guys,
Imagine I have a very simple: surf(peaks) 3d surface.
I would like to show a tiny pop-up window for a given x and y coordinate which only shows the 'Z' value? and it would be great if I can give the 'Z' a custom name.. such as "Monthly Income" for example.
Does this make sense?
Thank you
Accepted Answer
Walter Roberson
on 31 May 2015
0 votes
8 Comments
A
on 31 May 2015
Thank you Walter. Any chance you could give me a sample code? I'm a bit of a noob. I'm not sure how I can tell matlab to put up a data cursor at x,y and only have it show me the Z value and also give me the option to call the z value something else?
Thank you
Walter Roberson
on 31 May 2015
Have a look at the last example at http://www.mathworks.com/help/matlab/ref/datacursormode.html as it shows a custom update function that uses different wording.
Thanks so much. I almost have it working. The only thing is.. is there a way for the data cursor to already be showing when you graph it (i.e., add it programmatically at a specific x,y rather than click it with your mouse?)?
Thanks
Walter Roberson
on 31 May 2015
set(dcm_object, 'Enable', 'on')
A
on 1 Jun 2015
Hi Walter,
That just allows for the mouse to click on the figure to create a data cursor. I'm looking for a way for the data cursor to already be there without having to click at a particular x,y,z value. Also, I want to lock this so that the user is not able to click elsewhere with the mouse and get a new data cursor at another position. Hope this makes sense.
Walter Roberson
on 1 Jun 2015
Walter Roberson
on 2 Jun 2015
Keywords so this will get indexed by the search engine: datacursormode datatip createdatatip
A
on 2 Jun 2015
Done. Thanks. Will check out the link.
More Answers (0)
Categories
Find more on Data Import and Analysis in Help Center and File Exchange
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)