@@ -39,7 +39,7 @@ class MPLConfig(TConfig):
39
39
key = val optional comment
40
40
41
41
val should be valid python syntax, just as you would use when setting
42
- properties using rcParams. This should become more obvious by inspecting
42
+ properties using rcParams. This should become more obvious by inspecting
43
43
the default values listed herein.
44
44
45
45
Colors: for the color values below, you can either use
@@ -50,7 +50,7 @@ class MPLConfig(TConfig):
50
50
- a legal html color name, eg red, blue, darkslategray
51
51
52
52
Interactivity: see http://matplotlib.sourceforge.net/interactive.html.
53
-
53
+
54
54
### CONFIGURATION BEGINS HERE ###
55
55
"""
56
56
@@ -61,15 +61,15 @@ class MPLConfig(TConfig):
61
61
numerix = T .Trait ('numpy' , 'numpy' , 'numeric' , 'numarray' )
62
62
maskedarray = T .false
63
63
units = T .false
64
-
64
+
65
65
class backend (TConfig ):
66
66
"""Valid backends are: 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg',
67
67
'TkAgg', 'Agg', 'Cairo', 'PS', 'PDF', 'SVG'"""
68
68
use = T .Trait ('TkAgg' , mplT .BackendHandler ())
69
-
69
+
70
70
class cairo (TConfig ):
71
71
format = T .Trait ('png' , 'png' , 'ps' , 'pdf' , 'svg' )
72
-
72
+
73
73
class tk (TConfig ):
74
74
"""
75
75
window_focus : Maintain shell focus for TkAgg
@@ -78,7 +78,7 @@ class tk(TConfig):
78
78
79
79
window_focus = T .false
80
80
pythoninspect = T .false
81
-
81
+
82
82
class ps (TConfig ):
83
83
papersize = T .Trait ('letter' , 'auto' , 'letter' , 'legal' , 'ledger' ,
84
84
'A0' , 'A1' , 'A2' , 'A3' , 'A4' , 'A5' , 'A6' , 'A7' ,
@@ -87,22 +87,22 @@ class ps(TConfig):
87
87
'B8' , 'B9' , 'B10' )
88
88
useafm = T .false
89
89
fonttype = T .Trait (3 , 42 )
90
-
90
+
91
91
class distiller (TConfig ):
92
92
use = T .Trait (None , None , 'ghostscript' , 'xpdf' , False )
93
93
resolution = T .Float (6000 )
94
-
94
+
95
95
class pdf (TConfig ):
96
96
compression = T .Range (0 , 9 , 6 )
97
97
fonttype = T .Trait (3 , 42 )
98
98
inheritcolor = T .false
99
99
use14corefonts = T .false
100
-
100
+
101
101
class svg (TConfig ):
102
102
image_inline = T .true
103
103
image_noscale = T .false
104
104
embed_chars = T .true
105
-
105
+
106
106
class lines (TConfig ):
107
107
linewidth = T .Float (1.0 )
108
108
linestyle = T .Trait ('-' ,'--' ,'-.' , ':' , 'steps' , '' , ' ' , None )
@@ -122,10 +122,10 @@ class patch(TConfig):
122
122
linewidth = T .Float (1.0 )
123
123
facecolor = T .Trait ('blue' , mplT .ColorHandler ())
124
124
edgecolor = T .Trait ('black' , mplT .ColorHandler ())
125
- antialiased = T .true
125
+ antialiased = T .true
126
126
127
127
class font (TConfig ):
128
- family = T .Trait ('sans-serif' , 'sans-serif' , 'serif' , 'cursive' ,
128
+ family = T .Trait ('sans-serif' , 'sans-serif' , 'serif' , 'cursive' ,
129
129
'fantasy' , 'monospace' )
130
130
style = T .Trait ('normal' , 'normal' , 'italic' , 'oblique' )
131
131
variant = T .Trait ('normal' , 'normal' , 'small-caps' )
@@ -136,29 +136,29 @@ class font(TConfig):
136
136
'expanded' , 'extra-expanded' , 'ultra-expanded' ,
137
137
'wider' , 'narrower' )
138
138
size = T .Float (12.0 )
139
- serif = T .ListStr (["Bitstream Vera Serif" , "New Century Schoolbook" ,
140
- "Century Schoolbook L" , "Utopia" , "ITC Bookman" , "Bookman" ,
141
- "Nimbus Roman No9 L" , "Times New Roman" , "Times" , "Palatino" ,
139
+ serif = T .ListStr (["Bitstream Vera Serif" , "New Century Schoolbook" ,
140
+ "Century Schoolbook L" , "Utopia" , "ITC Bookman" , "Bookman" ,
141
+ "Nimbus Roman No9 L" , "Times New Roman" , "Times" , "Palatino" ,
142
142
"Charter" , "serif" ])
143
- sans_serif = T .ListStr (["Bitstream Vera Sans" , "Lucida Grande" , "Verdana" ,
144
- "Geneva" , "Lucid" , "Arial" , "Helvetica" , "Avant Garde" ,
143
+ sans_serif = T .ListStr (["Bitstream Vera Sans" , "Lucida Grande" , "Verdana" ,
144
+ "Geneva" , "Lucid" , "Arial" , "Helvetica" , "Avant Garde" ,
145
145
"sans-serif" ])
146
- cursive = T .ListStr (["Apple Chancery" , "Textile" , "Zapf Chancery" , "Sand" ,
146
+ cursive = T .ListStr (["Apple Chancery" , "Textile" , "Zapf Chancery" , "Sand" ,
147
147
"cursive" ])
148
- fantasy = T .ListStr (["Comic Sans MS" , "Chicago" , "Charcoal" , "Impact" , "Western" ,
148
+ fantasy = T .ListStr (["Comic Sans MS" , "Chicago" , "Charcoal" , "Impact" , "Western" ,
149
149
"fantasy" ])
150
150
monospace = T .ListStr (["Bitstream Vera Sans Mono" , "Andale Mono" , "Nimbus Mono L" ,
151
151
"Courier New" , "Courier" , "Fixed" , "Terminal" , "monospace" ])
152
152
153
153
class text (TConfig ):
154
154
color = T .Trait ('black' ,mplT .ColorHandler ())
155
155
usetex = T .false
156
-
156
+
157
157
class latex (TConfig ):
158
158
unicode = T .false
159
159
preamble = T .ListStr ([])
160
160
dvipnghack = T .false
161
-
161
+
162
162
class mathtext (TConfig ):
163
163
cal = T .Trait ('cursive' , mplT .FontconfigPatternHandler ())
164
164
rm = T .Trait ('serif' , mplT .FontconfigPatternHandler ())
@@ -182,16 +182,16 @@ class axes(TConfig):
182
182
'large' , 'x-large' , 'xx-large' , T .Float )
183
183
labelcolor = T .Trait ('black' , mplT .ColorHandler ())
184
184
axisbelow = T .false
185
-
185
+
186
186
class formatter (TConfig ):
187
187
limits = T .List (T .Float , [- 7 , 7 ], minlen = 2 , maxlen = 2 )
188
-
188
+
189
189
class xticks (TConfig ):
190
190
color = T .Trait ('black' , mplT .ColorHandler ())
191
191
labelsize = T .Trait ('small' , 'xx-small' , 'x-small' , 'small' , 'medium' ,
192
192
'large' , 'x-large' , 'xx-large' , T .Float )
193
193
direction = T .Trait ('in' , 'out' )
194
-
194
+
195
195
class major (TConfig ):
196
196
size = T .Float (4 )
197
197
pad = T .Float (4 )
@@ -205,7 +205,7 @@ class yticks(TConfig):
205
205
labelsize = T .Trait ('small' , 'xx-small' , 'x-small' , 'small' , 'medium' ,
206
206
'large' , 'x-large' , 'xx-large' , T .Float )
207
207
direction = T .Trait ('in' , 'out' )
208
-
208
+
209
209
class major (TConfig ):
210
210
size = T .Float (4 )
211
211
pad = T .Float (4 )
@@ -220,8 +220,8 @@ class grid(TConfig):
220
220
linewidth = T .Float (0.5 )
221
221
222
222
class legend (TConfig ):
223
- loc = T .Trait ('upper right' , 'best' , 'upper right' , 'upper left' ,
224
- 'lower left' , 'lower right' , 'right' , 'center left' ,
223
+ loc = T .Trait ('upper right' , 'best' , 'upper right' , 'upper left' ,
224
+ 'lower left' , 'lower right' , 'right' , 'center left' ,
225
225
'center right' , 'lower center' , 'upper center' , 'center' )
226
226
isaxes = T .true
227
227
numpoints = T .Int (3 )
@@ -264,26 +264,26 @@ class image(TConfig):
264
264
265
265
class contour (TConfig ):
266
266
negative_linestyle = T .Trait ('dashed' , 'dashed' , 'solid' )
267
-
267
+
268
268
class savefig (TConfig ):
269
269
dpi = T .Float (100 )
270
270
facecolor = T .Trait ('white' , mplT .ColorHandler ())
271
271
edgecolor = T .Trait ('white' , mplT .ColorHandler ())
272
272
orientation = T .Trait ('portrait' , 'portrait' , 'landscape' )
273
-
273
+
274
274
class verbose (TConfig ):
275
275
level = T .Trait ('silent' , 'silent' , 'helpful' , 'debug' , 'debug-annoying' )
276
276
fileo = T .Trait ('sys.stdout' , 'sys.stdout' , T .File )
277
277
278
278
279
279
class RcParamsWrapper (dict ):
280
-
280
+
281
281
"""A backwards-compatible interface to a traited config object
282
282
"""
283
-
283
+
284
284
def __init__ (self , tconfig ):
285
285
self .tconfig = tconfig
286
-
286
+
287
287
self .tconfig_map = {
288
288
'backend' : (self .tconfig .backend , 'use' ),
289
289
'numerix' : (self .tconfig , 'numerix' ),
@@ -337,7 +337,7 @@ def __init__(self, tconfig):
337
337
'text.latex.unicode' : (self .tconfig .text .latex , 'unicode' ),
338
338
'text.latex.preamble' : (self .tconfig .text .latex , 'preamble' ),
339
339
'text.dvipnghack' : (self .tconfig .text .latex , 'dvipnghack' ),
340
-
340
+
341
341
'mathtext.cal' : (self .tconfig .mathtext , 'cal' ),
342
342
'mathtext.rm' : (self .tconfig .mathtext , 'rm' ),
343
343
'mathtext.tt' : (self .tconfig .mathtext , 'tt' ),
@@ -455,7 +455,7 @@ def __getitem__(self, key):
455
455
456
456
def keys (self ):
457
457
return self .tconfig_map .keys ()
458
-
458
+
459
459
def has_key (self , val ):
460
460
return self .tconfig_map .has_key (val )
461
461
@@ -466,7 +466,7 @@ def update(self, arg, **kwargs):
466
466
except AttributeError :
467
467
for key , val in arg :
468
468
self [key ] = val
469
-
469
+
470
470
for key in kwargs :
471
471
self [key ] = kwargs [key ]
472
472
0 commit comments