File tree 2 files changed +14
-0
lines changed
examples/text_labels_and_annotations 2 files changed +14
-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
+ jupyter notebook users because ``bbox_inches='tight'`` is the default setting
13
+ for the ``%matplotlib inline`` backend.
8
14
"""
9
15
10
16
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 internally used
552
+ by the ``%matplotlib inline`` in 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