select line by touching with mouse
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos

this is a equity plotted
Is it possible to select one by touching it with the mouse?
0 comentarios
Respuestas (1)
John D'Errico
el 4 de Jun. de 2025
Editada: John D'Errico
el 4 de Jun. de 2025
"select curve?"
Well, yes, in a sense. When you plot the curve, you can supply a ButtonDownFcn, so that when you click on the curve, will initiate whatever code you write. In a very simple form, I did this:
mycallback = @(varargin) disp("yeah? what do ya want?");
plot(1:5,rand(1,5),buttondownfcn = mycallback)
Now, when I click on the curve, I see this grumpy response:
yeah? what do ya want?
But if I click on an empty part of the figure, I see nothing. The callback is only initiated when I click right on the curve.
You can be far more creative than what I did of course.
1 comentario
Ver también
Categorías
Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!