File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
examples/text_labels_and_annotations Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 55
66Matplotlib can wrap text automatically, but if it's too long, the text will be
77displayed 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.
815"""
916
1017import matplotlib .pyplot as plt
Original file line number Diff line number Diff line change @@ -544,6 +544,14 @@ def set_wrap(self, wrap):
544544 Parameters
545545 ----------
546546 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.
547555 """
548556 self ._wrap = wrap
549557
You can’t perform that action at this time.
0 commit comments