@@ -72,9 +72,53 @@ Changes in 1.2.x
72
72
original keyword arguments will override any value provided by
73
73
*capthick *.
74
74
75
- * Aritsts no longer have ``x_isdata `` or ``y_isdata `` attributes. Instead
75
+ * Transform subclassing behaviour is now subtly changed. If your transform
76
+ implements a non-affine transformation, then it should override the
77
+ ``transform_non_affine `` method, rather than the generic ``transform `` method.
78
+ Previously transforms would define ``transform `` and then copy the
79
+ method into ``transform_non_affine ``:
80
+
81
+ class MyTransform(mtrans.Transform):
82
+ def transform(self, xy):
83
+ ...
84
+ transform_non_affine = transform
85
+
86
+ This approach will no longer function correctly and should be changed to:
87
+
88
+ class MyTransform(mtrans.Transform):
89
+ def transform_non_affine(self, xy):
90
+ ...
91
+
92
+ * Artists no longer have ``x_isdata `` or ``y_isdata `` attributes; instead
76
93
any artist's transform can be interrogated with
77
- ``artist_instance.get_transform().is_data(ax.transData) ``
94
+ ``artist_instance.get_transform().contains_branch(ax.transData) ``
95
+
96
+ * Lines added to an axes now take into account their transform when updating the
97
+ data and view limits. This means transforms can now be used as a pre-transform.
98
+ For instance:
99
+
100
+ >>> import matplotlib.pyplot as plt
101
+ >>> import matplotlib.transforms as mtrans
102
+ >>> ax = plt.axes()
103
+ >>> ax.plot(range (10 ), transform = mtrans.Affine2D().scale(10 ) + ax.transData)
104
+ >>> print (ax.viewLim)
105
+ Bbox('array([[ 0., 0.],\n [ 90., 90.]])')
106
+
107
+ * One can now easily get a transform which goes from one transform's coordinate system
108
+ to another, in an optimized way, using the new subtract method on a transform. For instance,
109
+ to go from data coordinates to axes coordinates::
110
+
111
+ >>> import matplotlib.pyplot as plt
112
+ >>> ax = plt.axes()
113
+ >>> data2ax = ax.transData - ax.transAxes
114
+ >>> print(ax.transData.depth, ax.transAxes.depth)
115
+ 3, 1
116
+ >>> print(data2ax.depth)
117
+ 2
118
+
119
+ for versions before 2.0 this could only be achieved in a sub-optimal way, using
120
+ ``ax.transData + ax.transAxes.inverted() `` (depth is a new concept, but had it existed
121
+ it would return 4 for this example).
78
122
79
123
Changes in 1.1.x
80
124
================
0 commit comments