From: <md...@us...> - 2007-12-05 18:14:40
|
Revision: 4624 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4624&view=rev Author: mdboom Date: 2007-12-05 10:14:38 -0800 (Wed, 05 Dec 2007) Log Message: ----------- Make autolayout a configuration option. Modified Paths: -------------- branches/transforms/lib/matplotlib/axes.py branches/transforms/lib/matplotlib/config/mplconfig.py branches/transforms/lib/matplotlib/config/rcsetup.py branches/transforms/lib/matplotlib/figure.py branches/transforms/lib/matplotlib/rcsetup.py branches/transforms/matplotlibrc.template Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-12-05 17:25:34 UTC (rev 4623) +++ branches/transforms/lib/matplotlib/axes.py 2007-12-05 18:14:38 UTC (rev 4624) @@ -802,7 +802,7 @@ self.xaxis.set_clip_path(self.axesPatch) self.yaxis.set_clip_path(self.axesPatch) - self.titleOffsetTrans.clear() + self.titleOffsetTrans.clear().translate(0.0, 10.0) def clear(self): 'clear the axes' Modified: branches/transforms/lib/matplotlib/config/mplconfig.py =================================================================== --- branches/transforms/lib/matplotlib/config/mplconfig.py 2007-12-05 17:25:34 UTC (rev 4623) +++ branches/transforms/lib/matplotlib/config/mplconfig.py 2007-12-05 18:14:38 UTC (rev 4624) @@ -238,6 +238,7 @@ dpi = T.Float(80) facecolor = T.Trait('0.75', mplT.ColorHandler()) edgecolor = T.Trait('white', mplT.ColorHandler()) + autolayout = T.false class subplot(TConfig): """The figure subplot parameters. All dimensions are fraction @@ -415,6 +416,7 @@ 'figure.subplot.wspace' : (self.tconfig.figure.subplot, 'wspace'), 'figure.subplot.hspace' : (self.tconfig.figure.subplot, 'hspace'), + 'figure.autolayout' : (self.tconfig.figure, 'autolayout'), 'savefig.dpi' : (self.tconfig.savefig, 'dpi'), 'savefig.facecolor' : (self.tconfig.savefig, 'facecolor'), Modified: branches/transforms/lib/matplotlib/config/rcsetup.py =================================================================== --- branches/transforms/lib/matplotlib/config/rcsetup.py 2007-12-05 17:25:34 UTC (rev 4623) +++ branches/transforms/lib/matplotlib/config/rcsetup.py 2007-12-05 18:14:38 UTC (rev 4624) @@ -447,6 +447,7 @@ 'figure.subplot.wspace' : [0.2, ValidateInterval(0, 1, closedmin=False, closedmax=True)], 'figure.subplot.hspace' : [0.2, ValidateInterval(0, 1, closedmin=False, closedmax=True)], + 'figure.autolayout' : [False, validate_bool], # autolayout 'savefig.dpi' : [100, validate_float], # DPI 'savefig.facecolor' : ['w', validate_color], # facecolor; white Modified: branches/transforms/lib/matplotlib/figure.py =================================================================== --- branches/transforms/lib/matplotlib/figure.py 2007-12-05 17:25:34 UTC (rev 4623) +++ branches/transforms/lib/matplotlib/figure.py 2007-12-05 18:14:38 UTC (rev 4624) @@ -151,7 +151,7 @@ self.clf() self._cachedRenderer = None - self._autoLayout = False + self._autoLayout = rcParams['figure.autolayout'] def _get_dpi(self): return self._dpi @@ -185,7 +185,8 @@ else: for label in ax.get_xticklabels(): label.set_visible(False) - #self.subplots_adjust(bottom=bottom) + if not self._autoLayout: + self.subplots_adjust(bottom=bottom) def get_children(self): 'get a list of artists contained in the figure' Modified: branches/transforms/lib/matplotlib/rcsetup.py =================================================================== --- branches/transforms/lib/matplotlib/rcsetup.py 2007-12-05 17:25:34 UTC (rev 4623) +++ branches/transforms/lib/matplotlib/rcsetup.py 2007-12-05 18:14:38 UTC (rev 4624) @@ -447,6 +447,7 @@ 'figure.subplot.wspace' : [0.2, ValidateInterval(0, 1, closedmin=False, closedmax=True)], 'figure.subplot.hspace' : [0.2, ValidateInterval(0, 1, closedmin=False, closedmax=True)], + 'figure.autolayout' : [False, validate_bool], 'savefig.dpi' : [100, validate_float], # DPI 'savefig.facecolor' : ['w', validate_color], # facecolor; white Modified: branches/transforms/matplotlibrc.template =================================================================== --- branches/transforms/matplotlibrc.template 2007-12-05 17:25:34 UTC (rev 4623) +++ branches/transforms/matplotlibrc.template 2007-12-05 18:14:38 UTC (rev 4624) @@ -156,7 +156,7 @@ # 'tex': As TeX-like text. Text between $'s will be # formatted as a TeX math expression. # This setting has no effect when text.usetex is True. - # In that case, all text will be sent to TeX for + # In that case, all text will be sent to TeX for # processing. # The following settings allow you to select the fonts in math mode. @@ -171,7 +171,7 @@ #mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix', # 'stixsans' or 'custom' #mathtext.fallback_to_cm : True # When True, use symbols from the Computer Modern - # fonts when a symbol can not be found in one of + # fonts when a symbol can not be found in one of # the custom math fonts. ### AXES @@ -247,6 +247,7 @@ #figure.subplot.wspace : 0.2 # the amount of width reserved for blank space between subplots #figure.subplot.hspace : 0.2 # the amount of height reserved for white space between subplots +#figure.autolayout : False # when True, adjust the axes so that text doesn't overlap ### IMAGES #image.aspect : equal # equal | auto | a number This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |