8000 fix rc file defaults issue for docs; python 2.4 compliance for formla… · matplotlib/matplotlib@f954a51 · GitHub
[go: up one dir, main page]

Skip to content

Commit f954a51

Browse files
committed
fix rc file defaults issue for docs; python 2.4 compliance for formlayout
svn path=/branches/v1_0_maint/; revision=8889
1 parent 42b8388 commit f954a51

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

doc/matplotlibrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ lines.linewidth : 1.5 # line width in points
232232

233233
### FIGURE
234234
# See http://matplotlib.sourceforge.net/matplotlib.figure.html#Figure
235-
figure.figsize : 6, 4 # figure size in inches
235+
figure.figsize : 5.5, 4.5 # figure size in inches
236236
#figure.dpi : 80 # figure dots per inch
237237
#figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray
238238
#figure.edgecolor : white # figure edgecolor

lib/matplotlib/__init__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ def rc_params(fail_on_error=False):
762762

763763
# this is the instance used by the matplotlib classes
764764
rcParams = rc_params()
765+
rcParamsOrig = rcParams.copy()
765766

766767
rcParamsDefault = RcParams([ (key, default) for key, (default, converter) in \
767768
defaultParams.iteritems() ])
@@ -843,11 +844,19 @@ def rc(group, **kwargs):
843844

844845
def rcdefaults():
845846
"""
846-
Restore the default rc params - the ones that were created at
847-
matplotlib load time.
847+
Restore the default rc params - these are not the params loaded by
848+
the rc file, but mpl's internal params. See rc_file_defaults for
849+
reloading the default params from the rc file
848850
"""
849851
rcParams.update(rcParamsDefault)
850852

853+
def rc_file_defaults():
854+
"""
855+
Restore the default rc params from the original matplotlib rc that
856+
was loaded
857+
"""
858+
rcParams.update(rcParamsOrig)
859+
851860
_use_error_msg = """ This call to matplotlib.use() has no effect
852861
because the the backend has already been chosen;
853862
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,

lib/matplotlib/backends/qt4_editor/formlayout.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,11 @@ def setup(self):
272272
field.setCurrentIndex(selindex)
273273
elif isinstance(value, bool):
274274
field = QCheckBox(self)
275-
field.setCheckState(Qt.Checked if value else Qt.Unchecked)
275+
if value:
276+
field.setCheckState(Qt.Checked)
277+
else:
278+
field.setCheckedState(Qt.Unchecked)
279+
276280
elif isinstance(value, float):
277281
field = QLineEdit(repr(value), self)
278282
elif isinstance(value, int):

0 commit comments

Comments
 (0)
0