Ahora está siguiendo esta pregunta
- Verá actualizaciones en las notificaciones de contenido en seguimiento.
- Podrá recibir correos electrónicos, en función de las preferencias de comunicación que haya establecido.
How to enable a figure so that if I click on a point and it will show the value?
Respuesta aceptada
28 comentarios
- 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.
Más respuestas (0)
Ver también
Categorías
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Se ha producido un error
No se puede completar la acción debido a los cambios realizados en la página. Vuelva a cargar la página para ver el estado actualizado.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- 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-Pacífico
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)