[讨论] 如何从plot上面用鼠标撷取某范围资料

楼主: l60km (/hr)   2017-08-22 14:57:08
各位大大好,目前写了一个资料处理的GUI,想要从画出来的plot(x,y)上面,让user用滑
鼠拖曳撷取某一区间,例如x(15:70),然后获得区间内的平均值mean(y(15:70)),
任何关键字都好,谢谢!
作者: YoursEver (猪是妳)   2017-08-22 15:25:00
rect = getrect( fig ); <== Can it work?
作者: profyang (prof)   2017-08-22 15:37:00
ginput
作者: YoursEver (猪是妳)   2017-08-22 15:50:00
ginput collects only points, but getrect can specifspecify a rectangle region.Oops, I see. "ginput" also works in this case.google: subsetting a graphics image (cropping), MatMatlab.
楼主: l60km (/hr)   2017-08-22 16:17:00
感谢两位,both works,ginput用点选的、getrect用拖曳的。

Links booklink

Contact Us: admin [ a t ] ucptt.com