Exemple #1
0
    def _draw_hexagon2(self, renderer, gc, xt, yt):
        offset = 0.6*renderer.points_to_pixels(self._markersize)
        offsetX1 = offset*0.5
        offsetY1 = offset*0.87
        rgbFace = self._get_rgb_face()
        if self._newstyle:
            path = agg.path_storage()
            path.move_to(offset, 0)
            path.line_to(offsetX1, offsetY1)
            path.line_to(-offsetX1, offsetY1)
            path.line_to(-offset, 0)
            path.line_to(-offsetX1, -offsetY1)
            path.line_to(offsetX1, -offsetY1)
            path.end_poly()

            renderer.draw_markers(gc, path, rgbFace, xt, yt, self._transform)
        else:
            for (x,y) in zip(xt, yt):
                verts = ( (x+offset, y),
                          (x+offsetX1, y+offsetY1),
                          (x-offsetX1, y+offsetY1),
                          (x-offset, y),
                          (x-offsetX1, y-offsetY1),
                          (x+offsetX1, y-offsetY1))
                renderer.draw_polygon(gc, rgbFace, verts)
Exemple #2
0
    def _draw_hexagon1(self, renderer, gc, xt, yt, point=False):
        offset = 0.6*renderer.points_to_pixels(self._markersize)
        if point:
            offset *= self._point_size_reduction
        offsetX1 = offset*0.87
        offsetY1 = offset*0.5
        rgbFace = self._get_rgb_face()

        if self._newstyle:
            path = agg.path_storage()
            path.move_to(0, offset)
            path.line_to(-offsetX1, offsetY1)
            path.line_to(-offsetX1, -offsetY1)
            path.line_to(0, -offset)
            path.line_to(offsetX1, -offsetY1)
            path.line_to(offsetX1, offsetY1)
            path.end_poly()
            renderer.draw_markers(gc, path, rgbFace, xt, yt, self.get_transform())
        else:
            for (x,y) in zip(xt, yt):
                verts = ( (x, y+offset),
                          (x-offsetX1, y+offsetY1),
                          (x-offsetX1, y-offsetY1),
                          (x, y-offset),
                          (x+offsetX1, y-offsetY1),
                          (x+offsetX1, y+offsetY1))
                renderer.draw_polygon(gc, rgbFace, verts)
Exemple #3
0
    def _draw_pentagon(self, renderer, gc, xt, yt):
        offset = 0.6*renderer.points_to_pixels(self._markersize)
        offsetX1 = offset*0.95
        offsetY1 = offset*0.31
        offsetX2 = offset*0.59
        offsetY2 = offset*0.81
        rgbFace = self._get_rgb_face()

        if self._newstyle:
            path = agg.path_storage()
            path.move_to(0, offset)
            path.line_to(-offsetX1, offsetY1)
            path.line_to(-offsetX2, -offsetY2)
            path.line_to(+offsetX2, -offsetY2)
            path.line_to(+offsetX1, offsetY1)
            path.end_poly()

            renderer.draw_markers(gc, path, rgbFace, xt, yt, self.get_transform())
        else:
            for (x,y) in zip(xt, yt):
                verts = ( (x, y+offset),
                          (x-offsetX1, y+offsetY1),
                          (x-offsetX2, y-offsetY2),
                          (x+offsetX2, y-offsetY2),
                          (x+offsetX1, y+offsetY1))
                renderer.draw_polygon(gc, rgbFace, verts)
Exemple #4
0
    def _draw_circle(self, renderer, gc, xt, yt, point=False):

        w = renderer.points_to_pixels(self._markersize)
        if point:
            w *= self._point_size_reduction


        rgbFace = self._get_rgb_face()

        if self._newstyle:
            N = 50.0
            r = w/2.
            rads = (2*math.pi/N)*arange(N)
            xs = r*cos(rads)
            ys = r*sin(rads)
            # todo: use curve3!
            path = agg.path_storage()
            path.move_to(xs[0], ys[0])
            for x, y in zip(xs[1:], ys[1:]):
                path.line_to(x, y)

            path.end_poly()
            renderer.draw_markers(gc, path, rgbFace, xt, yt, self._transform)
        else:
            for (x,y) in zip(xt, yt):
                renderer.draw_arc(gc, rgbFace,
                                  x, y, w, w, 0.0, 360.0)
Exemple #5
0
    def _draw_pentagon(self, renderer, gc, xt, yt):
        offset = 0.6 * renderer.points_to_pixels(self._markersize)
        offsetX1 = offset * 0.95
        offsetY1 = offset * 0.31
        offsetX2 = offset * 0.59
        offsetY2 = offset * 0.81
        rgbFace = self._get_rgb_face()

        if self._newstyle:
            path = agg.path_storage()
            path.move_to(0, offset)
            path.line_to(-offsetX1, offsetY1)
            path.line_to(-offsetX2, -offsetY2)
            path.line_to(+offsetX2, -offsetY2)
            path.line_to(+offsetX1, offsetY1)
            path.end_poly()

            renderer.draw_markers(gc, path, rgbFace, xt, yt,
                                  self.get_transform())
        else:
            for (x, y) in zip(xt, yt):
                verts = ((x, y + offset), (x - offsetX1, y + offsetY1),
                         (x - offsetX2, y - offsetY2),
                         (x + offsetX2, y - offsetY2), (x + offsetX1,
                                                        y + offsetY1))
                renderer.draw_polygon(gc, rgbFace, verts)
Exemple #6
0
    def _draw_hexagon1(self, renderer, gc, xt, yt, point=False):
        offset = 0.6 * renderer.points_to_pixels(self._markersize)
        if point:
            offset *= self._point_size_reduction
        offsetX1 = offset * 0.87
        offsetY1 = offset * 0.5
        rgbFace = self._get_rgb_face()

        if self._newstyle:
            path = agg.path_storage()
            path.move_to(0, offset)
            path.line_to(-offsetX1, offsetY1)
            path.line_to(-offsetX1, -offsetY1)
            path.line_to(0, -offset)
            path.line_to(offsetX1, -offsetY1)
            path.line_to(offsetX1, offsetY1)
            path.end_poly()
            renderer.draw_markers(gc, path, rgbFace, xt, yt,
                                  self.get_transform())
        else:
            for (x, y) in zip(xt, yt):
                verts = ((x, y + offset), (x - offsetX1, y + offsetY1),
                         (x - offsetX1, y - offsetY1), (x, y - offset),
                         (x + offsetX1, y - offsetY1), (x + offsetX1,
                                                        y + offsetY1))
                renderer.draw_polygon(gc, rgbFace, verts)
Exemple #7
0
 def _draw_tickleft(self, renderer, gc, xt, yt):
     offset = renderer.points_to_pixels(self._markersize)
     if self._newstyle:
         path = agg.path_storage()
         path.move_to(-offset, 0.5)
         path.line_to(0, 0.5)
         renderer.draw_markers(gc, path, None, xt, yt, self.get_transform())
     else:
         for (x, y) in zip(xt, yt):
             renderer.draw_line(gc, x - offset, y, x, y)
Exemple #8
0
 def _draw_vline(self, renderer, gc, xt, yt):
     offset = 0.5 * renderer.points_to_pixels(self._markersize)
     if self._newstyle:
         path = agg.path_storage()
         path.move_to(0, -offset)
         path.line_to(0, offset)
         renderer.draw_markers(gc, path, None, xt, yt, self.get_transform())
     else:
         for (x, y) in zip(xt, yt):
             renderer.draw_line(gc, x, y - offset, x, y + offset)
Exemple #9
0
 def _draw_vline(self, renderer, gc, xt, yt):
     offset = 0.5*renderer.points_to_pixels(self._markersize)
     if self._newstyle:
         path = agg.path_storage()
         path.move_to(0, -offset)
         path.line_to(0, offset)
         renderer.draw_markers(gc, path, None, xt, yt, self.get_transform())
     else:
         for (x,y) in zip(xt, yt):
             renderer.draw_line(gc, x, y-offset, x, y+offset)
Exemple #10
0
 def _draw_tickleft(self, renderer, gc, xt, yt):
     offset = renderer.points_to_pixels(self._markersize)
     if self._newstyle:
         path = agg.path_storage()
         path.move_to(-offset, 0.5)
         path.line_to(0, 0.5)
         renderer.draw_markers(gc, path, None, xt, yt, self.get_transform())
     else:
         for (x,y) in zip(xt, yt):
             renderer.draw_line(gc, x-offset, y, x, y)
Exemple #11
0
 def _draw_hline(self, renderer, gc, xt, yt):
     offset = 0.5*renderer.points_to_pixels(self._markersize)
     if self._newstyle:
         path = agg.path_storage()
         path.move_to(-offset, 0)
         path.line_to(offset, 0)
         renderer.draw_markers(gc, path, None, xt, yt, self._transform)
     else:
         for (x,y) in zip(xt, yt):
             renderer.draw_line(gc, x-offset, y, x+offset, y)
Exemple #12
0
 def _draw_tickdown(self, renderer, gc, xt, yt):
     offset = renderer.points_to_pixels(self._markersize)
     if self._newstyle:
         path = agg.path_storage()
         path.move_to(-0.5, -offset)
         path.line_to(-0.5, 0)
         renderer.draw_markers(gc, path, None, xt, yt, self._transform)
     else:
         for (x,y) in zip(xt, yt):
             renderer.draw_line(gc, x, y-offset, x, y)
Exemple #13
0
 def _draw_pixel(self, renderer, gc, xt, yt):
     if self._newstyle:
         rgbFace = self._get_rgb_face()
         path = agg.path_storage()
         path.move_to(-0.5, -0.5)
         path.line_to(-0.5, 0.5)
         path.line_to(0.5, 0.5)
         path.line_to(0.5, -0.5)
         renderer.draw_markers(gc, path, rgbFace, xt, yt, self._transform)
     else:
         for (x,y) in zip(xt, yt):
             renderer.draw_point(gc, x, y)
Exemple #14
0
 def _draw_caretup(self, renderer, gc, xt, yt):
     offset = 0.5*renderer.points_to_pixels(self._markersize)
     offset1 = 1.5*offset
     if self._newstyle:
         path = agg.path_storage()
         path.move_to(-offset, -offset1)
         path.line_to(0, 0)
         path.line_to(+offset, -offset1)
         renderer.draw_markers(gc, path, None, xt, yt, self.get_transform())
     else:
         for (x,y) in zip(xt, yt):
             renderer.draw_line(gc, x-offset, y-offset1, x, y)
             renderer.draw_line(gc, x, y, x+offset, y-offset1)
Exemple #15
0
 def _draw_caretup(self, renderer, gc, xt, yt):
     offset = 0.5 * renderer.points_to_pixels(self._markersize)
     offset1 = 1.5 * offset
     if self._newstyle:
         path = agg.path_storage()
         path.move_to(-offset, -offset1)
         path.line_to(0, 0)
         path.line_to(+offset, -offset1)
         renderer.draw_markers(gc, path, None, xt, yt, self.get_transform())
     else:
         for (x, y) in zip(xt, yt):
             renderer.draw_line(gc, x - offset, y - offset1, x, y)
             renderer.draw_line(gc, x, y, x + offset, y - offset1)
Exemple #16
0
 def _draw_triangle_right(self, renderer, gc, xt, yt):
     offset = 0.5 * renderer.points_to_pixels(self._markersize)
     rgbFace = self._get_rgb_face()
     if self._newstyle:
         path = agg.path_storage()
         path.move_to(offset, 0)
         path.line_to(-offset, -offset)
         path.line_to(-offset, offset)
         path.end_poly()
         renderer.draw_markers(gc, path, rgbFace, xt, yt, self._transform)
     else:
         for (x, y) in zip(xt, yt):
             verts = ((x + offset, y), (x - offset, y - offset), (x - offset, y + offset))
             renderer.draw_polygon(gc, rgbFace, verts)
Exemple #17
0
 def _draw_triangle_right(self, renderer, gc, xt, yt):
     offset = 0.5 * renderer.points_to_pixels(self._markersize)
     rgbFace = self._get_rgb_face()
     if self._newstyle:
         path = agg.path_storage()
         path.move_to(offset, 0)
         path.line_to(-offset, -offset)
         path.line_to(-offset, offset)
         path.end_poly()
         renderer.draw_markers(gc, path, rgbFace, xt, yt, self._transform)
     else:
         for (x, y) in zip(xt, yt):
             verts = ((x + offset, y), (x - offset, y - offset),
                      (x - offset, y + offset))
             renderer.draw_polygon(gc, rgbFace, verts)
Exemple #18
0
    def _draw_thin_diamond(self, renderer, gc, xt, yt):
        offset = 0.7 * renderer.points_to_pixels(self._markersize)
        xoffset = 0.6 * offset
        rgbFace = self._get_rgb_face()

        if self._newstyle:
            path = agg.path_storage()
            path.move_to(xoffset, 0)
            path.line_to(0, -offset)
            path.line_to(-xoffset, 0)
            path.line_to(0, offset)
            path.end_poly()
            renderer.draw_markers(gc, path, rgbFace, xt, yt, self._transform)
        else:
            for (x, y) in zip(xt, yt):
                verts = ((x + xoffset, y), (x, y - offset), (x - xoffset, y), (x, y + offset))
                renderer.draw_polygon(gc, rgbFace, verts)
Exemple #19
0
    def _draw_thin_diamond(self, renderer, gc, xt, yt):
        offset = 0.7 * renderer.points_to_pixels(self._markersize)
        xoffset = 0.6 * offset
        rgbFace = self._get_rgb_face()

        if self._newstyle:
            path = agg.path_storage()
            path.move_to(xoffset, 0)
            path.line_to(0, -offset)
            path.line_to(-xoffset, 0)
            path.line_to(0, offset)
            path.end_poly()
            renderer.draw_markers(gc, path, rgbFace, xt, yt, self._transform)
        else:
            for (x, y) in zip(xt, yt):
                verts = ((x + xoffset, y), (x, y - offset), (x - xoffset, y),
                         (x, y + offset))
                renderer.draw_polygon(gc, rgbFace, verts)
Exemple #20
0
 def _draw_tri_left(self, renderer, gc, xt, yt):
     offset = 0.5*renderer.points_to_pixels(self._markersize)
     offset1 = offset*0.8
     offset2 = offset*0.5
     if self._newstyle:
         path = agg.path_storage()
         path.move_to(0, 0)
         path.line_to(-offset, 0)
         path.move_to(0, 0)
         path.line_to(offset2, offset1)
         path.move_to(0, 0)
         path.line_to(offset2, -offset1)
         renderer.draw_markers(gc, path, None, xt, yt, self._transform)
     else:
         for (x,y) in zip(xt, yt):
             renderer.draw_line(gc, x, y, x-offset, y)
             renderer.draw_line(gc, x, y, x+offset2, y+offset1)
             renderer.draw_line(gc, x, y, x+offset2, y-offset1)
Exemple #21
0
    def _draw_square(self, renderer, gc, xt, yt):
        side = renderer.points_to_pixels(self._markersize)
        offset = side * 0.5
        rgbFace = self._get_rgb_face()

        if self._newstyle:

            path = agg.path_storage()
            path.move_to(-offset, -offset)
            path.line_to(-offset, offset)
            path.line_to(offset, offset)
            path.line_to(offset, -offset)
            path.end_poly()

            renderer.draw_markers(gc, path, rgbFace, xt, yt, self._transform)
        else:

            for (x, y) in zip(xt, yt):
                renderer.draw_rectangle(gc, rgbFace, x - offset, y - offset, side, side)
Exemple #22
0
    def _draw_square(self, renderer, gc, xt, yt):
        side = renderer.points_to_pixels(self._markersize)
        offset = side * 0.5
        rgbFace = self._get_rgb_face()

        if self._newstyle:

            path = agg.path_storage()
            path.move_to(-offset, -offset)
            path.line_to(-offset, offset)
            path.line_to(offset, offset)
            path.line_to(offset, -offset)
            path.end_poly()

            renderer.draw_markers(gc, path, rgbFace, xt, yt, self._transform)
        else:

            for (x, y) in zip(xt, yt):
                renderer.draw_rectangle(gc, rgbFace, x - offset, y - offset,
                                        side, side)
Exemple #23
0
        def arc(theta1, theta2, trans, n=None):
            """
            Returns an arc on the unit circle from angle theta1 to
            angle theta2 (in degrees).  The returned arc is already
            transformed using the affine transformation matrix trans.
            The arc is returned as an agg::path_storage object.

            If n is provided, it is the number of spline segments to make.
            If n is not provided, the number of spline segments is determined
            based on the delta between theta1 and theta2.
            """
            # From Masionobe, L.  2003.  "Drawing an elliptical arc using
            # polylines, quadratic or cubic Bezier curves".
            #
            # http://www.spaceroots.org/documents/ellipse/index.html

            # degrees to radians
            theta1 *= npy.pi / 180.0
            theta2 *= npy.pi / 180.0

            twopi = npy.pi * 2.0
            halfpi = npy.pi * 0.5

            eta1 = npy.arctan2(npy.sin(theta1), npy.cos(theta1))
            eta2 = npy.arctan2(npy.sin(theta2), npy.cos(theta2))
            eta2 -= twopi * npy.floor((eta2 - eta1) / twopi)
            if (theta2 - theta1 > npy.pi) and (eta2 - eta1 < npy.pi):
                eta2 += twopi

            # number of curve segments to make
            if n is None:
                n = int(2**npy.ceil((eta2 - eta1) / halfpi))

            deta = (eta2 - eta1) / n
            t = npy.tan(0.5 * deta)
            alpha = npy.sin(deta) * (npy.sqrt(4.0 + 3.0 * t * t) - 1) / 3.0

            steps = npy.linspace(eta1, eta2, n + 1, True)
            cos_eta = npy.cos(steps)
            sin_eta = npy.sin(steps)

            xA = cos_eta[:-1]
            yA = sin_eta[:-1]
            xA_dot = -yA
            yA_dot = xA

            xB = cos_eta[1:]
            yB = sin_eta[1:]
            xB_dot = -yB
            yB_dot = xB

            length = n * 3 + 1
            vertices = npy.zeros((length, 2), npy.float_)
            vertices[0] = [xA[0], yA[0]]
            end = length

            vertices[1::3, 0] = xA + alpha * xA_dot
            vertices[1::3, 1] = yA + alpha * yA_dot
            vertices[2::3, 0] = xB - alpha * xB_dot
            vertices[2::3, 1] = yB - alpha * yB_dot
            vertices[3::3, 0] = xB
            vertices[3::3, 1] = yB

            vertices = affine_transform(vertices, trans)

            path = agg.path_storage()
            path.move_to(*vertices[0])
            for i in range(1, length, 3):
                path.curve4(*vertices[i:i + 3].flat)
            return path
Exemple #24
0
    def draw(self, renderer):
        if not self.get_visible(): return
        #renderer.open_group('patch')
        gc = renderer.new_gc()
        gc.set_foreground(self._edgecolor)
        gc.set_linewidth(self._linewidth)
        gc.set_alpha(self._alpha)
        gc.set_antialiased(self._antialiased)
        self._set_gc_clip(gc)

        gc.set_capstyle('projecting')

        if not self.fill or self._facecolor is None: rgbFace = None
        else: rgbFace = colors.colorConverter.to_rgb(self._facecolor)

        if self._hatch:
            gc.set_hatch(self._hatch)

        if not hasattr(renderer, 'draw_path'):
            mpl.verbose.report(
                'patches.Ellipse renderer does not support path drawing; falling back on vertex approximation for nonlinear transformation'
            )
            renderer.draw_polygon(gc, rgbFace, self.get_verts())
            return

        x, y = self.center
        x = self.convert_xunits(x)
        y = self.convert_yunits(y)
        w = self.convert_xunits(self.width) / 2.
        h = self.convert_yunits(self.height) / 2.

        theta = self.angle * npy.pi / 180.
        T = npy.array([[1, 0, x], [0, 1, y], [0, 0, 1]])

        S = npy.array([[w, 0, 0], [0, h, 0], [0, 0, 1]])

        # rotate by theta
        R = npy.array([[npy.cos(theta), -npy.sin(theta), 0],
                       [npy.sin(theta), npy.cos(theta), 0], [0, 0, 1]])

        # transform unit circle into ellipse
        E = npy.dot(T, npy.dot(R, S))

        # Apply the display affine
        sx, b, c, sy, tx, ty = self.get_transform().as_vec6_val()

        # display coords
        D = npy.array([[sx, b, tx], [c, sy, ty], [0, 0, 1]], npy.float_)

        M = npy.dot(D, E)

        C = npy.ones((3, len(self.circle)))
        C[0:2, :] = self.circle.T

        ellipse = npy.dot(M, C).T[:, :2]

        path = agg.path_storage()
        path.move_to(*ellipse[0])
        for i in range(1, 25, 3):
            path.curve4(*ellipse[i:i + 3].flat)
        path.close_polygon()

        renderer.draw_path(gc, rgbFace, path)
Exemple #25
0
        def arc(theta1, theta2, trans, n=None):
            """
            Returns an arc on the unit circle from angle theta1 to
            angle theta2 (in degrees).  The returned arc is already
            transformed using the affine transformation matrix trans.
            The arc is returned as an agg::path_storage object.

            If n is provided, it is the number of spline segments to make.
            If n is not provided, the number of spline segments is determined
            based on the delta between theta1 and theta2.
            """
            # From Masionobe, L.  2003.  "Drawing an elliptical arc using
            # polylines, quadratic or cubic Bezier curves".
            #
            # http://www.spaceroots.org/documents/ellipse/index.html

            # degrees to radians
            theta1 *= npy.pi / 180.0
            theta2 *= npy.pi / 180.0

            twopi  = npy.pi * 2.0
            halfpi = npy.pi * 0.5

            eta1 = npy.arctan2(npy.sin(theta1), npy.cos(theta1))
            eta2 = npy.arctan2(npy.sin(theta2), npy.cos(theta2))
            eta2 -= twopi * npy.floor((eta2 - eta1) / twopi)
            if (theta2 - theta1 > npy.pi) and (eta2 - eta1 < npy.pi):
                eta2 += twopi

            # number of curve segments to make
            if n is None:
                n = int(2 ** npy.ceil((eta2 - eta1) / halfpi))

            deta = (eta2 - eta1) / n
            t = npy.tan(0.5 * deta)
            alpha = npy.sin(deta) * (npy.sqrt(4.0 + 3.0 * t * t) - 1) / 3.0

            steps = npy.linspace(eta1, eta2, n + 1, True)
            cos_eta = npy.cos(steps)
            sin_eta = npy.sin(steps)

            xA = cos_eta[:-1]
            yA = sin_eta[:-1]
            xA_dot = -yA
            yA_dot = xA

            xB = cos_eta[1:]
            yB = sin_eta[1:]
            xB_dot = -yB
            yB_dot = xB

            length = n * 3 + 1
            vertices = npy.zeros((length, 2), npy.float_)
            vertices[0] = [xA[0], yA[0]]
            end = length

            vertices[1::3, 0] = xA + alpha * xA_dot
            vertices[1::3, 1] = yA + alpha * yA_dot
            vertices[2::3, 0] = xB - alpha * xB_dot
            vertices[2::3, 1] = yB - alpha * yB_dot
            vertices[3::3, 0] = xB
            vertices[3::3, 1] = yB

            vertices = affine_transform(vertices, trans)

            path = agg.path_storage()
            path.move_to(*vertices[0])
            for i in range(1, length, 3):
                path.curve4(*vertices[i:i+3].flat)
            return path
Exemple #26
0
    def draw(self, renderer):
        if not self.get_visible(): return
        #renderer.open_group('patch')
        gc = renderer.new_gc()
        gc.set_foreground(self._edgecolor)
        gc.set_linewidth(self._linewidth)
        gc.set_alpha(self._alpha)
        gc.set_antialiased(self._antialiased)
        self._set_gc_clip(gc)

        gc.set_capstyle('projecting')

        if not self.fill or self._facecolor is None: rgbFace = None
        else: rgbFace = colors.colorConverter.to_rgb(self._facecolor)

        if self._hatch:
            gc.set_hatch(self._hatch )


        if not hasattr(renderer, 'draw_path'):
            mpl.verbose.report('patches.Ellipse renderer does not support path drawing; falling back on vertex approximation for nonlinear transformation')
            renderer.draw_polygon(gc, rgbFace, self.get_verts())
            return


        x, y = self.center
        x = self.convert_xunits(x)
        y = self.convert_yunits(y)
        w = self.convert_xunits(self.width)/2.
        h = self.convert_yunits(self.height)/2.

        theta = self.angle * npy.pi/180.
        T = npy.array([
            [1, 0, x],
            [0, 1, y],
            [0, 0, 1]])




        S = npy.array([
            [w, 0, 0],
            [0, h, 0],
            [0, 0, 1]])



        # rotate by theta
        R = npy.array([
            [npy.cos(theta),  -npy.sin(theta), 0],
            [npy.sin(theta), npy.cos(theta), 0],
            [0,           0,          1]])

        # transform unit circle into ellipse
        E = npy.dot(T, npy.dot(R, S))


        # Apply the display affine
        sx, b, c, sy, tx, ty = self.get_transform().as_vec6_val()

        # display coords
        D = npy.array([
            [sx, b, tx],
            [c, sy, ty],
            [0, 0, 1]], npy.float_)

        M = npy.dot(D,E)

        C = npy.ones((3, len(self.circle)))
        C[0:2,:] = self.circle.T

        ellipse = npy.dot(M, C).T[:,:2]

        path =  agg.path_storage()
        path.move_to(*ellipse[0])
        for i in range(1, 25, 3):
            path.curve4(*ellipse[i:i+3].flat)
        path.close_polygon()

        renderer.draw_path(gc, rgbFace, path)