Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dadc302

Browse files
committed
recleanup of axes imports
svn path=/trunk/matplotlib/; revision=3554
1 parent 2e54167 commit dadc302

5 files changed

Lines changed: 348 additions & 315 deletions

File tree

README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ EXAMPLES
5454

5555
AUTHOR
5656

57-
John D. Hunter <[email protected]>
58-
Copyright (c) 2002-2004 John D. Hunter; All Rights Reserved.
57+
John D. Hunter <[email protected]>
58+
Copyright (c) 2002-2007 John D. Hunter; All Rights Reserved.
5959

6060
Jeremy O'Donoghue wrote the wx backend
6161

examples/agg_test.py

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -106,36 +106,39 @@
106106
renderer.color_rgba8( white )
107107
agg.render_scanlines_rgba(rasterizer, scanline, renderer);
108108

109-
## Copy a rectangle from the buffer the rectangle defined by
110-
## x0,y0->x1,y1 and paste it at xdest, ydest
111-
x0, y0 = 10, 50
112-
x1, y1 = 110, 190
113-
xdest, ydest = 350, 200
114-
115-
116-
widthr, heightr = x1-x0, y1-y0
117-
strider = widthr*4
118-
copybuffer = agg.buffer(widthr, heightr, strider)
119-
120-
rbufcopy = agg.rendering_buffer()
121-
rbufcopy.attachb(copybuffer)
122-
pfcopy = agg.pixel_format_rgba(rbufcopy)
123-
rbasecopy = agg.renderer_base_rgba(pfcopy)
124-
125-
rect = agg.rect(x0, y0, x1, y1)
126-
print rect.is_valid()
127-
rectp = agg.rectPtr(rect)
128-
#print dir(rbasecopy)
129-
130-
# agg is funny about the arguments to copy from; the last 2 args are
131-
# dx, dy. If the src and dest buffers are the same size and you omit
132-
# the dx and dy args, the position of the copy in the dest buffer is
133-
# the same as in the src. Since our dest buffer is smaller than our
134-
# src buffer, we have to offset the location by -x0, -y0
135-
rbasecopy.copy_from(rbuf, rect, -x0, -y0);
136-
137-
# paste the rectangle at a new location xdest, ydest
138-
rbase.copy_from(rbufcopy, None, xdest, ydest);
109+
if 0:
110+
## Copy a rectangle from the buffer the rectangle defined by
111+
## x0,y0->x1,y1 and paste it at xdest, ydest
112+
x0, y0 = 10, 50
113+
x1, y1 = 110, 190
114+
xdest, ydest = 350, 200
115+
116+
117+
118+
widthr, heightr = x1-x0, y1-y0
119+
strider = widthr*4
120+
copybuffer = agg.buffer(widthr, heightr, strider)
121+
122+
123+
rbufcopy = agg.rendering_buffer()
124+
rbufcopy.attachb(copybuffer)
125+
pfcopy = agg.pixel_format_rgba(rbufcopy)
126+
rbasecopy = agg.renderer_base_rgba(pfcopy)
127+
128+
rect = agg.rect(x0, y0, x1, y1)
129+
print rect.is_valid()
130+
rectp = agg.rectPtr(rect)
131+
#print dir(rbasecopy)
132+
133+
# agg is funny about the arguments to copy from; the last 2 args are
134+
# dx, dy. If the src and dest buffers are the same size and you omit
135+
# the dx and dy args, the position of the copy in the dest buffer is
136+
# the same as in the src. Since our dest buffer is smaller than our
137+
# src buffer, we have to offset the location by -x0, -y0
138+
rbasecopy.copy_from(rbuf, rect, -x0, -y0);
139+
140+
# paste the rectangle at a new location xdest, ydest
141+
rbase.copy_from(rbufcopy, None, xdest, ydest);
139142

140143

141144

lib/matplotlib/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,6 @@ def get_info(self, s):
801801
"""
802802
pass
803803

804-
805-
806804
class Namespace:
807805
"""
808806
A class which takes a list of modules and creates an object with
@@ -832,3 +830,4 @@ def __init__(self, modstr):
832830
mod = getattr(basemod, name)
833831
setattr(self, name, mod)
834832

833+

0 commit comments

Comments
 (0)