LSSTApplications  18.1.0
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | List of all members
lsst.afw.geom.ellipses.EllipseMatplotlibInterface Class Reference

Public Member Functions

def __init__ (self, ellipse, scale=1.0, kwds)
 
def __getattr__ (self, name)
 
def update (self, show=True, rescale=True)
 

Public Attributes

 scale
 
 patch
 

Detailed Description

An interface for drawing the ellipse using matplotlib.

This is typically initiated by calling Ellipse.plot(), which
adds the interface as the matplotlib attribute of the ellipse
object (this can be deleted later if desired).

Definition at line 39 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.afw.geom.ellipses.EllipseMatplotlibInterface.__init__ (   self,
  ellipse,
  scale = 1.0,
  kwds 
)

Definition at line 47 of file __init__.py.

47  def __init__(self, ellipse, scale=1.0, **kwds):
48  import matplotlib.patches
49  self.__ellipse = weakref.proxy(ellipse)
50  self.scale = float(scale)
51  core = Axes(self.__ellipse.getCore())
52  core.scale(2.0 * scale)
53  self.patch = matplotlib.patches.Ellipse(
54  (self.__ellipse.getCenter().getX(), self.__ellipse.getCenter().getY()),
55  core.getA(), core.getB(), core.getTheta() * 180.0 / numpy.pi,
56  **kwds
57  )
58 
def __init__(self, minimum, dataRange, Q)

Member Function Documentation

◆ __getattr__()

def lsst.afw.geom.ellipses.EllipseMatplotlibInterface.__getattr__ (   self,
  name 
)

Definition at line 59 of file __init__.py.

59  def __getattr__(self, name):
60  return getattr(self.patch, name)
61 

◆ update()

def lsst.afw.geom.ellipses.EllipseMatplotlibInterface.update (   self,
  show = True,
  rescale = True 
)
Update the matplotlib representation to the current ellipse parameters.

Definition at line 62 of file __init__.py.

62  def update(self, show=True, rescale=True):
63  """Update the matplotlib representation to the current ellipse parameters.
64  """
65  import matplotlib.patches
66  core = _agl.Axes(self.__ellipse.getCore())
67  core.scale(2.0 * scale)
68  new_patch = matplotlib.patches.Ellipse(
69  (self.__ellipse.getCenter().getX(), self.__ellipse.getCenter().getY()),
70  core.a, core.b, core.theta * 180.0 / numpy.pi
71  )
72  new_patch.update_from(self.patch)
73  axes = self.patch.get_axes()
74  if axes is not None:
75  self.patch.remove()
76  axes.add_patch(new_patch)
77  self.patch = new_patch
78  if axes is not None:
79  if rescale:
80  axes.autoscale_view()
81  if show:
82  axes.figure.canvas.draw()
83 
84 

Member Data Documentation

◆ patch

lsst.afw.geom.ellipses.EllipseMatplotlibInterface.patch

Definition at line 53 of file __init__.py.

◆ scale

lsst.afw.geom.ellipses.EllipseMatplotlibInterface.scale

Definition at line 50 of file __init__.py.


The documentation for this class was generated from the following file: