File tree 2 files changed +15
-0
lines changed
examples/text_labels_and_annotations
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 5
5
6
6
Matplotlib can wrap text automatically, but if it's too long, the text will be
7
7
displayed slightly outside of the boundaries of the axis anyways.
8
+
9
+ Note: Auto-wrapping does not work together with
10
+ ``savefig(..., bbox_inches='tight')``. The 'tight' setting rescales the canvas
11
+ to accommodate all content and happens before wrapping. This affects
12
+ ``%matplotlib inline`` in IPython and Jupyter notebooks where the inline
13
+ setting uses ``bbox_inches='tight'`` by default when saving the image to
14
+ embed.
8
15
"""
9
16
10
17
import matplotlib .pyplot as plt
Original file line number Diff line number Diff line change @@ -544,6 +544,14 @@ def set_wrap(self, wrap):
544
544
Parameters
545
545
----------
546
546
wrap : bool
547
+
548
+ Notes
549
+ -----
550
+ Wrapping does not work together with
551
+ ``savefig(..., bbox_inches='tight')`` (which is also used internally
552
+ by ``%matplotlib inline`` in IPython/Jupyter). The 'tight' setting
553
+ rescales the canvas to accommodate all content and happens before
554
+ wrapping.
547
555
"""
548
556
self ._wrap = wrap
549
557
You can’t perform that action at this time.
0 commit comments