Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 67b683c

Browse files
committed
Don't error on figure.autolayout -- just warn that it does nothing.
svn path=/trunk/matplotlib/; revision=5702
1 parent 4610641 commit 67b683c

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

lib/matplotlib/config/rcsetup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ def validate_fonttype(s):
8383
'None','classic','toolbar2',
8484
], ignorecase=True)
8585

86+
def validate_autolayout(v):
87+
if v:
88+
warnings.warn("figure.autolayout is not currently supported")
89+
8690
class validate_nseq_float:
8791
def __init__(self, n):
8892
self.n = n
@@ -439,6 +443,7 @@ def __call__(self, s):
439443
'figure.dpi' : [80, validate_float], # DPI
440444
'figure.facecolor' : ['0.75', validate_color], # facecolor; scalar gray
441445
'figure.edgecolor' : ['w', validate_color], # edgecolor; white
446+
'figure.autolayout' : [False, validate_autolayout],
442447

443448
'figure.subplot.left' : [0.125, ValidateInterval(0, 1, closedmin=False, closedmax=False)],
444449
'figure.subplot.right' : [0.9, ValidateInterval(0, 1, closedmin=False, closedmax=False)],

lib/matplotlib/rcsetup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"""
1515

1616
import os
17+
import warnings
1718
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
1819
from matplotlib.colors import is_color_like
1920

@@ -109,6 +110,10 @@ def validate_fonttype(s):
109110
'None','classic','toolbar2',
110111
], ignorecase=True)
111112

113+
def validate_autolayout(v):
114+
if v:
115+
warnings.warn("figure.autolayout is not currently supported")
116+
112117
class validate_nseq_float:
113118
def __init__(self, n):
114119
self.n = n
@@ -449,6 +454,7 @@ def __call__(self, s):
449454
'figure.dpi' : [ 80, validate_float], # DPI
450455
'figure.facecolor' : [ '0.75', validate_color], # facecolor; scalar gray
451456
'figure.edgecolor' : [ 'w', validate_color], # edgecolor; white
457+
'figure.autolayout' : [ False, validate_autolayout],
452458

453459
'figure.subplot.left' : [0.125, ValidateInterval(0, 1, closedmin=True, closedmax=True)],
454460
'figure.subplot.right' : [0.9, ValidateInterval(0, 1, closedmin=True, closedmax=True)],

0 commit comments

Comments
 (0)