def __init__(self, ax, *args, **kwargs): if kwargs.has_key("sigma"): scale_units = kwargs.get("scale_units", "xy") kwargs["scale_units"] = scale_units if kwargs["scale_units"] != "xy": raise ValueError('scale units must be "xy" when sigma is given') angles = kwargs.get("angles", "xy") kwargs["angles"] = angles if kwargs["angles"] != "xy": raise ValueError('angles must be "xy" when sigma is given') if not kwargs.has_key("scale"): kwargs["scale"] = 1.0 su, sv, rho = kwargs.pop("sigma", (None, None, None)) self.ellipse_kwargs = {"edgecolors": "k", "facecolors": "none", "linewidths": 1.0} user_ellipse_kwargs = kwargs.pop("ellipse_kwargs", {}) if user_ellipse_kwargs.has_key("offsets"): raise ValueError("cannot specify ellipse offsets") if user_ellipse_kwargs.has_key("units"): raise ValueError("cannot specify ellipse units") self.ellipse_kwargs.update(user_ellipse_kwargs) _Quiver.__init__(self, ax, *args, **kwargs) if (su is not None) & (sv is not None) & (rho is not None): self._update_ellipsoids(su, sv, rho)
def __init__(self,ax,*args,**kwargs): if 'sigma' in kwargs: scale_units = kwargs.get('scale_units','xy') kwargs['scale_units'] = scale_units if kwargs['scale_units'] != 'xy': raise ValueError('scale units must be "xy" when sigma is given') angles = kwargs.get('angles','xy') kwargs['angles'] = angles if kwargs['angles'] != 'xy': raise ValueError('angles must be "xy" when sigma is given') sigma = kwargs.pop('sigma',None) ellipse_kwargs = kwargs.pop('ellipse_kwargs',{}) if 'offsets' in ellipse_kwargs: raise ValueError('cannot specify ellipse offsets') if 'units' in ellipse_kwargs: raise ValueError('cannot specify ellipse units') self.ellipse_kwargs = {'edgecolors':'k', 'facecolors':'none', 'linewidths':1.0} self.ellipse_kwargs.update(ellipse_kwargs) self.ellipsoids = None _Quiver.__init__(self,ax,*args,**kwargs) if sigma is not None: if self.scale is None: self.scale = _estimate_scale(self.X,self.Y,self.U,self.V) su,sv,rho = sigma[0],sigma[1],sigma[2] self._update_ellipsoids(su,sv,rho)
def set_UVC(self, u, v, C=None, sigma=None): if C is None: _Quiver.set_UVC(self, u, v) else: _Quiver.set_UVC(self, u, v, C) if sigma is not None: su, sv, rho = sigma[0], sigma[1], sigma[2] self._update_ellipsoids(su, sv, rho)
def set_UVC(self,u,v,C=None,sigma=None): if C is None: _Quiver.set_UVC(self,u,v) else: _Quiver.set_UVC(self,u,v,C) if sigma is not None: su,sv,rho = sigma[0],sigma[1],sigma[2] self._update_ellipsoids(su,sv,rho)
def __init__(self,ax,*args,**kwargs): if kwargs.has_key('sigma'): kwargs['scale_units'] = 'xy' kwargs['angles'] = 'xy' if not kwargs.has_key('scale'): kwargs['scale'] = 1.0 su,sv,rho = kwargs.pop('sigma',(None,None,None)) self.ellipse_kwargs = {} self.ellipse_kwargs['edgecolors'] = kwargs.pop('ellipse_edgecolors','k') self.ellipse_kwargs['facecolors'] = kwargs.pop('ellipse_facecolors','none') self.ellipse_kwargs['linewidths'] = kwargs.pop('ellipse_linewidths',2.0) _Quiver.__init__(self, ax, *args, **kwargs) if (su is not None) & (sv is not None): self._update_ellipsoids(su,sv,rho)
def __init__(self, ax, *args, **kwargs): if 'sigma' in kwargs: kwargs['scale_units'] = 'xy' kwargs['angles'] = 'xy' if 'scale' not in kwargs: kwargs['scale'] = 1.0 su, sv, rho = kwargs.pop('sigma', (None, None, None)) self.ellipse_kwargs = {} self.ellipse_kwargs['zorder'] = kwargs.get('zorder') self.ellipse_kwargs['edgecolors'] = kwargs.pop('ellipse_edgecolors', 'k') self.ellipse_kwargs['facecolors'] = kwargs.pop('ellipse_facecolors', 'none') self.ellipse_kwargs['linewidths'] = kwargs.pop('ellipse_linewidths', 1.0) _Quiver.__init__(self, ax, *args, **kwargs) if (su is not None) & (sv is not None): self._update_ellipsoids(su, sv, rho)
def __init__(self, ax, *args, **kwargs): if 'sigma' in kwargs: scale_units = kwargs.get('scale_units', 'xy') kwargs['scale_units'] = scale_units if kwargs['scale_units'] != 'xy': raise ValueError( 'scale units must be "xy" when sigma is given') angles = kwargs.get('angles', 'xy') kwargs['angles'] = angles if kwargs['angles'] != 'xy': raise ValueError('angles must be "xy" when sigma is given') sigma = kwargs.pop('sigma', None) ellipse_kwargs = kwargs.pop('ellipse_kwargs', {}) if 'offsets' in ellipse_kwargs: raise ValueError('cannot specify ellipse offsets') if 'units' in ellipse_kwargs: raise ValueError('cannot specify ellipse units') self.ellipse_kwargs = { 'edgecolors': 'k', 'facecolors': 'none', 'linewidths': 1.0 } self.ellipse_kwargs.update(ellipse_kwargs) self.ellipsoids = None _Quiver.__init__(self, ax, *args, **kwargs) if sigma is not None: if self.scale is None: self.scale = _estimate_scale(self.X, self.Y, self.U, self.V) su, sv, rho = sigma[0], sigma[1], sigma[2] self._update_ellipsoids(su, sv, rho)
def remove(self): # remove the quiver and ellipsoid collection _Quiver.remove(self) if self.ellipsoids is not None: self.ellipsoids.remove()