作者l60km (/hr)
看板MATLAB
标题[讨论] 如何从plot上面用滑鼠撷取某范围资料
时间Tue Aug 22 14:57:08 2017
各位大大好,目前写了一个资料处理的GUI,想要从画出来的plot(x,y)上面,让user用滑
鼠拖曳撷取某一区间,例如x(15:70),然後获得区间内的平均值mean(y(15:70)),
任何关键字都好,谢谢!
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.137.253.0
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MATLAB/M.1503385030.A.B4E.html
1F:推 YoursEver: rect = getrect( fig ); <== Can it work? 08/22 15:25
2F:推 profyang: ginput 08/22 15:37
3F:→ YoursEver: ginput collects only points, but getrect can specif 08/22 15:50
4F:→ YoursEver: specify a rectangle region. 08/22 15:50
5F:→ YoursEver: Oops, I see. "ginput" also works in this case. 08/22 16:03
6F:→ YoursEver: google: subsetting a graphics image (cropping), Mat 08/22 16:04
7F:→ YoursEver: Matlab. 08/22 16:04
8F:→ l60km: 感谢两位,both works,ginput用点选的、getrect用拖曳的。 08/22 16:17