Skip to content

Commit fcf341e

Browse files
darribasjorisvandenbossche
authored andcommitted
BUG: Call draw before adding attribution (#95) (#96)
1 parent e0bb257 commit fcf341e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

contextily/plotting.py

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from rasterio.enums import Resampling
88
from rasterio.warp import transform_bounds
99
from matplotlib import patheffects
10+
from matplotlib.pyplot import draw
1011

1112
INTERPOLATION = "bilinear"
1213
ZOOM = "auto"
@@ -186,6 +187,11 @@ def add_attribution(ax, text, font_size=ATTRIBUTION_SIZE, **kwargs):
186187
matplotlib.text.Text
187188
Matplotlib Text object added to the plot.
188189
"""
190+
# Add draw() as it resizes the axis and allows the wrapping to work as
191+
# expected. See https://github.com/darribas/contextily/issues/95 for some
192+
# details on the issue
193+
draw()
194+
189195
text_artist = ax.text(
190196
0.005,
191197
0.005,

0 commit comments

Comments
 (0)