MPLView.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:pythonista-scripts 作者: khilnani 项目源码 文件源码
def __init__(self, *args, **kwargs):
      PinchView.__init__(self,*args,**kwargs)
      # prevent resize from causing redraw until we r ready
      self.ready=threading.Lock()
      #self.ready.acquire()

      self.img_view = ui.ImageView(frame=self.bounds,flex='WH')
      self.add_subview(self.img_view)
      self.b = io.BytesIO()

      #store base xlim and ylim, only update when drag ends
      self.xlim=plt.xlim()
      self.ylim=plt.ylim()
      self.centroid=tuple(self.center) # zoom center

      # fast and slow dpi.. 
      self.high_dpi=72.0
      self.low_dpi=16
      # set output image size to match view size.  this probably should be modified to use actual device dpi and size.  fonts and line width are based on pts, not pixels
      plt.gcf().set_size_inches(self.width/self.high_dpi,self.height/self.high_dpi)
      #update plot, ensuring update really happens
      self.update_plt(dpi=self.high_dpi, waitForLock=True)

      ObjCInstance(self).becomeFirstResponder()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号