return QObject.eventFilter(self, obj, event)
class XYView(View):
- AUTOFIT_MARGIN = 0.1 # 3%
+ AUTOFIT_MARGIN = 0.03 # 3%
# See http://matplotlib.org/api/markers_api.html:
CURVE_MARKERS = [ "o" ,# circle
xm, xM = self._mplAxes.xaxis.get_data_interval()
ym, yM = self._mplAxes.yaxis.get_data_interval()
i = yM-ym
+ j = xM-xm
if np.isfinite(xm) and np.isfinite(xM) and np.isfinite(ym) and np.isfinite(yM):
- self._mplAxes.axis([xm, xM, ym-i*self.AUTOFIT_MARGIN, yM+i*self.AUTOFIT_MARGIN])
+ self._mplAxes.axis([xm-j*self.AUTOFIT_MARGIN, xM+j*self.AUTOFIT_MARGIN,
+ ym-i*self.AUTOFIT_MARGIN, yM+i*self.AUTOFIT_MARGIN])
if repaint:
self.repaint()