Skip to content

Commit eaaa791

Browse files
committed
Docstring fix & small adjustements
1 parent 5151cf5 commit eaaa791

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/api/demo_affine_image.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
For the backends that supports draw_image with optional affine
33
transform (e.g., agg, ps backend), the image of the output should
4-
have its boundary matches the red rectangles.
4+
have its boundary matches the red dashed rectangle.
55
"""
66

77
import numpy as np
@@ -23,23 +23,24 @@ def get_image():
2323

2424
if 1:
2525

26-
# image rotation
27-
2826
fig, ax1 = plt.subplots(1, 1)
2927
Z = get_image()
3028
im1 = ax1.imshow(Z, interpolation='none',
3129
origin='lower',
3230
extent=[-2, 4, -3, 2], clip_on=True)
3331

32+
# image rotation
3433
trans_data2 = mtransforms.Affine2D().rotate_deg(30) + ax1.transData
3534
im1.set_transform(trans_data2)
3635

3736
# display intended extent of the image
3837
x1, x2, y1, y2 = im1.get_extent()
3938
x3, y3 = x2, y1
4039

41-
ax1.plot([x1, x2, x2, x1, x1], [y1, y1, y2, y2, y1], "--",
40+
ax1.plot([x1, x2, x2, x1, x1], [y1, y1, y2, y2, y1], "--r", lw=3,
4241
transform=trans_data2)
4342

4443
ax1.set_xlim(-3, 5)
4544
ax1.set_ylim(-4, 4)
45+
46+
plt.show()

0 commit comments

Comments
 (0)