@@ -172,15 +172,15 @@ def auto_adjust_subplotpars(
172172 margin_bottom += pad_inches / fig_height_inch
173173
174174 if margin_left + margin_right >= 1 :
175- margin_left = 0.4999
176- margin_right = 0.4999
177- warnings .warn ('The left and right margins cannot be made large '
175+ warnings .warn ('Tight layout not applied. The left and right margins '
176+ 'cannot be made large '
178177 'enough to accommodate all axes decorations. ' )
178+ return None
179179 if margin_bottom + margin_top >= 1 :
180- margin_bottom = 0.4999
181- margin_top = 0.4999
182- warnings .warn ('The bottom and top margins cannot be made large '
180+ warnings .warn ('Tight layout not applied. '
181+ 'The bottom and top margins cannot be made large '
183182 'enough to accommodate all axes decorations. ' )
183+ return None
184184
185185 kwargs = dict (left = margin_left ,
186186 right = 1 - margin_right ,
@@ -195,9 +195,10 @@ def auto_adjust_subplotpars(
195195 # axes widths:
196196 h_axes = (1 - margin_right - margin_left - hspace * (cols - 1 )) / cols
197197 if h_axes < 0 :
198- warnings .warn ('tight_layout cannot make axes width small enough '
198+ warnings .warn ('Tight layout not applied. '
199+ 'tight_layout cannot make axes width small enough '
199200 'to accommodate all axes decorations' )
200- kwargs [ "wspace" ] = 0.5
201+ return None
201202 else :
202203 kwargs ["wspace" ] = hspace / h_axes
203204
@@ -206,9 +207,10 @@ def auto_adjust_subplotpars(
206207 + vpad_inches / fig_height_inch )
207208 v_axes = (1 - margin_top - margin_bottom - vspace * (rows - 1 )) / rows
208209 if v_axes < 0 :
209- warnings .warn ('tight_layout cannot make axes height small enough '
210+ warnings .warn ('Tight layout not applied. '
211+ 'tight_layout cannot make axes height small enough '
210212 'to accommodate all axes decorations' )
211- kwargs [ "hspace" ] = 0.5
213+ return None
212214 else :
213215 kwargs ["hspace" ] = vspace / v_axes
214216
0 commit comments