
Al momento, stai seguendo questa domanda
- Vedrai gli aggiornamenti nel tuofeed del contenuto seguito.
- Potresti ricevere delle e-mail a seconda delle tuepreferenze per le comunicazioni.
How to enable a figure so that if I click on a point and it will show the value?
Risposta accettata

29 Commenti
- I clicked on 3 dots and 3 coordinates were returned to the command window. I used those 3 coordinates to add 3 red X's. You can see 2 on the figure below. The 3rd one is covered up by the data tip. If the coordinates were inaccurate, they would not have matched the 3 points I clicked on.
- I turned on data tips and clicked on those same 3 points to see their coordinates within the plot. One of the data tips is shows below. Those numbers matched my outputs perfectly.


- There is a new nested function "returnSelectedCoordinate()" within the button callback function. This replaces the m file you attached.
- The plot is now a 3D plot but it only shows the (x,y) axes so it appears as a 2D plot. This has the advantage of keeping your data together rather than separating the z coordinates. This was also implemented in my answer.
- The returnSelectedCoordinate() function extracts the (x,y,z) coordinates from the axes so you no longer have to send those coordinates into the function. This is much cleaner and safer. This was also implemented in my answer.
- The returnSelectedCoordinate() function not only prints the (x,y,z) coordinates to the command window but, importantly, it also draws a blue circle around the (x,y,z) output coordinates! It uses the output coordinates and the blue circle correctly is drawn around the point selected. This confirms it's working properly. You can comment that out later.
Più risposte (0)
Vedere anche
Categorie
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Si è verificato un errore
Impossibile completare l'azione a causa delle modifiche apportate alla pagina. Ricarica la pagina per vedere lo stato aggiornato.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)
Asia-Pacifico
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)

