How to click onto x-y coordinate and run a script related to this x-y coordinate?

1 回表示 (過去 30 日間)
Marina Delac
Marina Delac 2012 年 12 月 19 日
Hi, I hope somebody can advise whether this is possible, and if it is, then how.
I am plotting x-y data. I want to be able to click onto a x-y coordinate, and this click would enable a run of a script that would open/plot another figure.
In my case I am plotting eigenvalues (real and imag axis). I want to click on an eigenvalue and get another figure which would plot participation factors related to this eigenvalue.
Many thanks, Marina.

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 12 月 19 日
It could be hacked using datacursormode and a custom callback.
But you will probably find it easier to use a ButtonDownFcn axes callback (after having set the plotted lines themselves to HitTest off). The callback would need to figure out what was being clicked on and react appropriately.

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by