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

Skip to content

Commit 1162001

Browse files
committed
doc/tst
1 parent 88f047b commit 1162001

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

lib/matplotlib/collections.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ def get_datalim(self, transData):
187187
# This operation depends on the transforms for the data in the
188188
# collection and whether the collection has offsets.
189189
#
190-
# 1) offsets = None, transform = transData: use the paths for the
191-
# automatic limits (i.e. for LineCollection in streamline).
192-
# 2) offsets != None: offset_transform = transData:
193-
# a) transform = transData: use the path + offset for limits (i.e
194-
# for bar).
195-
# b) transform != transData: just use the offsets for the limits
196-
# (i.e. for scatter)
190+
# 1) offsets = None, transform child of transData: use the paths for
191+
# the automatic limits (i.e. for LineCollection in streamline).
192+
# 2) offsets != None: offset_transform is child of transData:
193+
# a) transform is child of transData: use the path + offset for
194+
# limits (i.e for bar).
195+
# b) transform is not a child of transData: just use the offsets
196+
# for the limits (i.e. for scatter)
197197
# 3) otherwise return a null Bbox.
198198

199199
transform = self.get_transform()

lib/matplotlib/tests/test_streamplot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ def test_direction():
9292

9393
def test_streamplot_limits():
9494
ax = plt.axes()
95-
x = np.linspace(-5, 10, 20) + 25
96-
y = np.linspace(-2, 4, 10) + 32
95+
x = np.linspace(-5, 10, 20)
96+
y = np.linspace(-2, 4, 10)
9797
y, x = np.meshgrid(y, x)
98-
# trans = mtransforms.Affine2D().translate(25, 32) + ax.transData
99-
plt.barbs(x, y, np.sin(x), np.cos(y))
98+
trans = mtransforms.Affine2D().translate(25, 32) + ax.transData
99+
plt.barbs(x, y, np.sin(x), np.cos(y), transform=trans)
100100
# The calculated bounds are approximately the bounds of the original data,
101101
# this is because the entire path is taken into account when updating the
102102
# datalim.

0 commit comments

Comments
 (0)