필터 지우기
필터 지우기

Adding points to plots with mouse input from the user

조회 수: 3 (최근 30일)
Jason Goad
Jason Goad 2013년 9월 5일
I am trying to figure out a way to assign values to variables based on the location of various clicks of a mouse on a .jpg or .png image.
Specifically, I would like to add plots to the orbitals of gravitationally bound binary stars using data from various double star observation catalogues.
So in this example, what I want to be able to do with MATLAB is prompt the user to "Please click on the 0 tick mark and then on the 1 tick mark." Given the x,y coordinates of those tick marks I could then determine how many pixels represent one arcsecond on each individual image. I could then prompt the user to click the center of the image, on the + mark, and that would tell me the x,y coordinate of the center. From that information I could automatically plot the next projected orbit given by the catalogues I mentioned earlier.
Is this at all possible? Is there a better way?
Thank you in advance!

답변 (1개)

Simon
Simon 2013년 9월 5일
Hi!
Try "ginput"!

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by