Create figure2 from point selected in figure1 until closing figure1
Show older comments
Hi,
I am working with a pair of figures that I would like to make more interactive. I have two vectors: v1, v2.
- In Figure 1, I plot points from v1.
- Then I select an observation in Figure 1, i_obs.
- A Figure 2 is created with a bar indicating the value v2(i_obs).
The point is that I would like to keep on clicking points in Figure 1 and creating the subsequent Figures 2 until I close Figure 1. By the moment what I have is the following, but I cannot keep Figure 1 open in order to clik and re-draw Figure 2 (it's just a single-use pair of Figures). So...any help please?
Thank you so much in advance :)
plot(v1)
datacursormode on
waitforbuttonpress
dcm_obj = datacursormode(gcf);
dc_info = getCursorInfo(dcm_obj);
figure, bar(v2(dc_info.DataIndex))
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Object Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!