Skip to content

Commit 03f2755

Browse files
committed
*** empty log message ***
svn path=/trunk/matplotlib/; revision=1414
1 parent b9e6cba commit 03f2755

File tree

5 files changed

+42
-10
lines changed

5 files changed

+42
-10
lines changed

.matplotlibrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ font.monospace : Andale Mono, Bitstream Vera Sans Mono, Nimbus Mono L, Cour
123123
# http://matplotlib.sourceforge.net/matplotlib.text.html for more
124124
# information on text properties
125125
text.color : black
126-
text.usetex : False # experimental
126+
text.usetex : False # use tex for all text handling. See http://matplotlib.sf.net/matplotlib.texmanager.html
127127

128128
### AXES
129129
# default face and edge color, default tick sizes,

lib/matplotlib/artist.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def pprint_getters(self):
372372
return lines
373373

374374

375-
def get(o, *args):
375+
def getp(o, *args):
376376
"""
377377
Return the value of handle property s
378378
@@ -403,6 +403,9 @@ def get(o, *args):
403403
func = getattr(o, 'get_' + name)
404404
return func()
405405

406+
def get(o, *args, **kwargs):
407+
return geto(o, *args, **kwargs)
408+
get.__doc__ = getp.__doc__
406409

407410
def set(*args, **kwargs):
408411
message = 'set deprecated because it overrides python2.4 builtin set. Use setp'

lib/matplotlib/pylab.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,11 @@
204204
import image
205205
from matplotlib import rcParams, rcParamsDefault, get_backend
206206
from backend_bases import FigureCanvasBase
207-
from artist import ArtistInspector, get
207+
from artist import ArtistInspector, getp, get
208208
from artist import setp as _setp
209209

210-
getp = get
210+
211+
211212

212213
from image import imread as _imread
213214
from lines import Line2D
@@ -451,6 +452,7 @@ def colormaps():
451452
pass
452453

453454

455+
454456
def get_current_fig_manager():
455457
figManager = _pylab_helpers.Gcf.get_active()
456458
if figManager is None:
@@ -1485,6 +1487,8 @@ def set(*args, **kwargs):
14851487

14861488
return setp(*args, **kwargs)
14871489

1490+
1491+
14881492
def setp(*args, **kwargs):
14891493
ret = _setp(*args, **kwargs)
14901494
draw_if_interactive()

lib/matplotlib/texmanager.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
11
"""
2-
A class to manage TeX to figure conversion.
2+
This module supports embedded TeX expressions in matplotlib via dvipng
3+
and dvips for the raster and postscript backends. The tex and
4+
dvipng/dvips information is cached in ~/.tex.cache for reuse between
5+
sessions
36
4-
Requires tex to be installed on your system
7+
Requirements:
58
6-
For raster output, eg for the agg backend, this module
7-
requires dvipng to be installed.
9+
tex
810
11+
*Agg backends: dvipng
12+
13+
PS backend: latex w/ psfrag, dvips
14+
15+
Backends:
16+
17+
Only supported on *Agg and PS backends currently
18+
19+
20+
For raster output, you can get RGBA numerix arrays from TeX expressions
21+
as follows
22+
23+
texmanager = TexManager()
24+
s = r'\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!'
25+
Z = self.texmanager.get_rgba(s, size=12, dpi=80, rgb=(1,0,0))
26+
27+
To enable tex rendering of all text in your matplotlib figure, set
28+
text.usetex in your matplotlibrc file
29+
(http://matplotlib.sf.net/.matplotlibrc)
930
1031
"""
11-
import os, sys, md5
32+
33+
import os, sys, md5, shutil
1234
from matplotlib import get_home, get_data_path
1335
from matplotlib._image import readpng
1436
from matplotlib.numerix import ravel, where, array, \
@@ -59,7 +81,7 @@ def make_dvi(self, tex, force=0):
5981
#sin, sout = os.popen2(command)
6082
#sout.close()
6183
os.system(command)
62-
os.rename(dvitmp, dvifile)
84+
shutil.move(dvitmp, dvifile)
6385
os.remove(logfile)
6486
return dvifile
6587

lib/matplotlib/ticker.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,9 @@ def set_locs(self, locs):
299299
def _set_offset(self, range):
300300
# offset of 20,001 is 20,000, for example
301301
locs = self.locs
302+
303+
if locs is None or not len(locs):
304+
self.offset = 0
302305
ave_loc = mean(locs)
303306
if ave_loc: # dont want to take log10(0)
304307
ave_oom = math.floor(math.log10(mean(absolute(locs))))

0 commit comments

Comments
 (0)