Sie verfolgen jetzt diese Frage
- Aktualisierungen können Sie in Ihrem Feed verfolgter Inhalte sehen.
- Je nach Ihren Kommunikationseinstellungen können Sie auch E-Mails erhalten.
How to enable a figure so that if I click on a point and it will show the value?
Akzeptierte Antwort
28 Kommentare
- 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.
Weitere Antworten (0)
Siehe auch
Kategorien
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Es ist ein Fehler aufgetreten
Da Änderungen an der Seite vorgenommen wurden, kann diese Aktion nicht abgeschlossen werden. Laden Sie die Seite neu, um sie im aktualisierten Zustand anzuzeigen.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- 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)
Asien-Pazifik
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)