@@ -27,24 +27,17 @@ def curvelinear_test1(fig):
2727 Grid for custom transform.
2828 """
2929
30- def tr (x , y ):
31- x , y = np .asarray (x ), np .asarray (y )
32- return x , y - x
33-
34- def inv_tr (x , y ):
35- x , y = np .asarray (x ), np .asarray (y )
36- return x , y + x
30+ def tr (x , y ): return x , y - x
31+ def inv_tr (x , y ): return x , y + x
3732
3833 grid_helper = GridHelperCurveLinear ((tr , inv_tr ))
3934
4035 ax1 = fig .add_subplot (1 , 2 , 1 , axes_class = Axes , grid_helper = grid_helper )
41- # ax1 will have a ticks and gridlines defined by the given
42- # transform (+ transData of the Axes). Note that the transform of
43- # the Axes itself (i.e., transData) is not affected by the given
44- # transform.
45-
46- xx , yy = tr ([3 , 6 ], [5 , 10 ])
47- ax1 .plot (xx , yy , linewidth = 2.0 )
36+ # ax1 will have ticks and gridlines defined by the given transform (+
37+ # transData of the Axes). Note that the transform of the Axes itself
38+ # (i.e., transData) is not affected by the given transform.
39+ xx , yy = tr (np .array ([3 , 6 ]), np .array ([5 , 10 ]))
40+ ax1 .plot (xx , yy )
4841
4942 ax1 .set_aspect (1 )
5043 ax1 .set_xlim (0 , 10 )
0 commit comments