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

Skip to content

Commit c1ed82d

Browse files
committed
added copy bbox transform
svn path=/trunk/matplotlib/; revision=455
1 parent 4ae3fe1 commit c1ed82d

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

TODO

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,4 +512,6 @@ ZeroDivisionError: SeparableTransformation::eval_scalars yin interval is zero; c
512512

513513
-- update installing.html from INSTALL
514514

515-
-- rubberbanding broken on subplot_demo/gtk
515+
-- rubberbanding broken on subplot_demo/gtk
516+
517+
-- add copy/deepcopy support for transforms

unit/transforms_unit.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from matplotlib.transforms import get_bbox_transform
1010
from matplotlib.transforms import transform_bbox, inverse_transform_bbox
1111
from matplotlib.transforms import bbox_all
12+
from matplotlib.transforms import copy_bbox_transform
13+
1214

1315
def closeto(x,y):
1416
return abs(asarray(x)-asarray(y))<1e-10
@@ -250,3 +252,16 @@ def rand_transform():
250252
assert( closeto_seq( box.get_bounds(), (xmin, ymin, xmax-xmin, ymax-ymin)))
251253
print 'all tests passed'
252254

255+
256+
257+
t1 = rand_transform()
258+
oboundsx = t1.get_bbox1().intervalx().get_bounds()
259+
oboundsy = t1.get_bbox1().intervaly().get_bounds()
260+
t2 = copy_bbox_transform(t1)
261+
t1.get_bbox1().intervalx().set_bounds(1,2)
262+
t2.get_bbox2().intervaly().set_bounds(-1,12)
263+
newboundsx = t2.get_bbox1().intervalx().get_bounds()
264+
newboundsy = t2.get_bbox1().intervaly().get_bounds()
265+
assert(oboundsx==newboundsx)
266+
assert(oboundsy==newboundsy)
267+

0 commit comments

Comments
 (0)