You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
| 2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
| 2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
| 2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <md...@us...> - 2007-08-01 16:26:30
|
Revision: 3660
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3660&view=rev
Author: mdboom
Date: 2007-08-01 08:56:34 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Fix some win32 differences
Modified Paths:
--------------
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2007-08-01 15:35:54 UTC (rev 3659)
+++ trunk/matplotlib/setupext.py 2007-08-01 15:56:34 UTC (rev 3660)
@@ -358,7 +358,8 @@
def add_ft2font_flags(module):
'Add the module flags to ft2font extension'
if not get_pkgconfig(module, 'freetype2'):
- module.libraries.append('freetype')
+ module.libraries.extend(['freetype', 'z'])
+ add_base_flags(module)
basedirs = module.include_dirs[:] # copy the list to avoid inf loop!
for d in basedirs:
@@ -372,9 +373,8 @@
for d in basedirs:
p = os.path.join(d, 'freetype2/lib')
if os.path.exists(p): module.library_dirs.append(p)
-
- module.libraries.append('z')
- add_base_flags(module)
+ else:
+ add_base_flags(module)
if sys.platform == 'win32' and win32_compiler == 'mingw32':
module.libraries.append('gw32c')
@@ -451,10 +451,38 @@
'C:/GTK/include/gtk',
])
- add_base_flags(module)
+ add_base_flags(module)
+
+ if not os.environ.has_key('PKG_CONFIG_PATH'):
+ # If Gtk+ is installed, pkg-config is required to be installed
+ os.environ['PKG_CONFIG_PATH'] = 'C:\GTK\lib\pkgconfig'
+
+ pygtkIncludes = getoutput('pkg-config --cflags-only-I pygtk-2.0').split()
+ gtkIncludes = getoutput('pkg-config --cflags-only-I gtk+-2.0').split()
+ includes = pygtkIncludes + gtkIncludes
+ module.include_dirs.extend([include[2:] for include in includes])
+
+ pygtkLinker = getoutput('pkg-config --libs pygtk-2.0').split()
+ gtkLinker = getoutput('pkg-config --libs gtk+-2.0').split()
+ linkerFlags = pygtkLinker + gtkLinker
+
+ module.libraries.extend(
+ [flag[2:] for flag in linkerFlags if flag.startswith('-l')])
+
+ module.library_dirs.extend(
+ [flag[2:] for flag in linkerFlags if flag.startswith('-L')])
+
+ module.extra_link_args.extend(
+ [flag for flag in linkerFlags if not
+ (flag.startswith('-l') or flag.startswith('-L'))])
+ # visual studio doesn't need the math library
+ if sys.platform == 'win32' and win32_compiler == 'msvc' and 'm' in module.libraries:
+ module.libraries.remove('m')
+
if sys.platform != 'win32':
# If Gtk+ is installed, pkg-config is required to be installed
+ add_base_flags(module)
get_pkgconfig(module, 'pygtk-2.0 gtk+-2.0')
# visual studio doesn't need the math library
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 16:21:18
|
Revision: 3661
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3661&view=rev
Author: mdboom
Date: 2007-08-01 09:21:11 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Only display the raw version (not the SVN revision, which only refers
to one file and is basically wrong.)
Modified Paths:
--------------
trunk/matplotlib/setup.py
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py 2007-08-01 15:56:34 UTC (rev 3660)
+++ trunk/matplotlib/setup.py 2007-08-01 16:21:11 UTC (rev 3661)
@@ -108,14 +108,12 @@
BUILD_NXUTILS = 1
for line in file('lib/matplotlib/__init__.py').readlines():
- if (line.startswith('__version__') or
- line.startswith('__revision__') or
- line.startswith('__date__')):
+ if (line.startswith('__version__')):
exec(line.strip())
print_line()
print_raw("BUILDING MATPLOTLIB")
-print_status('matplotlib', '%s (r%s)' % (__version__, __revision__.split()[-2]))
+print_status('matplotlib', __version__)
print_status('python', sys.version)
print_status('platform', sys.platform)
if sys.platform == 'win32':
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 15:35:58
|
Revision: 3659
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3659&view=rev
Author: mdboom
Date: 2007-08-01 08:35:54 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Use numpy.inf
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/mathtext.py
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-08-01 15:07:29 UTC (rev 3658)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-08-01 15:35:54 UTC (rev 3659)
@@ -135,6 +135,7 @@
from sets import Set
from unicodedata import category
from warnings import warn
+import numpy
from matplotlib import verbose
from matplotlib.pyparsing import Literal, Word, OneOrMore, ZeroOrMore, \
@@ -607,7 +608,11 @@
r'\backslash': [('cal', '\x6e'), ('ex', '\xb2'), ('ex', '\x2f'),
('ex', '\xc2'), ('ex', '\x2d')],
r'/' : [('rm', '/'), ('ex', '\xb1'), ('ex', '\x2e'),
- ('ex', '\xcb'), ('ex', '\x2c')]
+ ('ex', '\xcb'), ('ex', '\x2c')],
+ r'\widehat' : [('rm', '\x5e'), ('ex', '\x62'), ('ex', '\x63'),
+ ('ex', '\x64')],
+ r'\widetilde': [('rm', '\x7e'), ('ex', '\x65'), ('ex', '\x66'),
+ ('ex', '\x67')]
}
for alias, target in [('\leftparen', '('),
@@ -1162,7 +1167,7 @@
List.__init__(self, elements)
self.vpack()
- def vpack(self, h=0., m='additional', l=float('inf')):
+ def vpack(self, h=0., m='additional', l=float(numpy.inf)):
"""The main duty of vpack is to compute the dimensions of the
resulting boxes, and to adjust the glue if one of those dimensions is
pre-specified.
@@ -1395,7 +1400,7 @@
self.super = None
Hlist.__init__(self, [])
-class AutoSizedDelim(Hlist):
+class AutoHeightChar(Hlist):
"""A class that will create a character as close to the given height
and depth as possible. When using a font with multiple height versions
of some characters (such as the BaKoMa fonts), the correct glyph will
@@ -1425,6 +1430,34 @@
shift = (depth - char.depth)
Hlist.__init__(self, [char])
self.shift_amount = shift
+
+class AutoWidthChar(Hlist):
+ """A class that will create a character as close to the given width
+ as possible. When using a font with multiple width versions
+ of some characters (such as the BaKoMa fonts), the correct glyph will
+ be selected, otherwise this will always just return a scaled version
+ of the glyph."""
+ def __init__(self, c, width, state, always=False):
+ alternatives = state.font_output.get_sized_alternatives_for_symbol(
+ state.font, c)
+
+ state = state.copy()
+ big_enough = False
+ for fontname, sym in alternatives:
+ state.font = fontname
+ char = Char(sym, state)
+ if char.width > width:
+ big_enough = True
+ break
+
+ # If the largest option is still not big enough, just do
+ # simple scale on it.
+ if not big_enough:
+ factor = width / char.width
+ state.fontsize *= factor
+ char = Char(sym, state)
+
+ Hlist.__init__(self, [char])
class Ship(object):
"""Once the boxes have been set up, this sends them to output.
@@ -1653,7 +1686,7 @@
bslash = Literal('\\')
accent = oneOf("hat check dot breve acute ddot grave tilde bar "
- "vec \" ` ' ~ . ^")
+ "vec \" ` ' ~ . ^ widehat widetilde")
function = oneOf("arccos csc ker min arcsin deg lg Pr arctan det "
"lim sec arg dim liminf sin cos exp limsup sinh "
@@ -1920,8 +1953,10 @@
r"\'" : r'\combiningacuteaccent',
r'\~' : r'\combiningtilde',
r'\.' : r'\combiningdotabove',
- r'\^' : r'\circumflexaccent',
+ r'\^' : r'\circumflexaccent'
}
+
+ _wide_accents = Set(r"\widehat \widetilde".split())
def accent(self, s, loc, toks):
assert(len(toks)==1)
@@ -1931,7 +1966,10 @@
if len(toks[0]) != 2:
raise ParseFatalException("Error parsing accent")
accent, sym = toks[0]
- accent = Accent(self._accent_map[accent], self.get_state())
+ if accent in self._wide_accents:
+ accent = AutoWidthChar(accent, sym.width, state)
+ else:
+ accent = Accent(self._accent_map[accent], state)
centered = HCentered([accent])
centered.hpack(sym.width, 'exactly')
centered.shift_amount = accent._metrics.xmin
@@ -2154,7 +2192,7 @@
# the height so it doesn't seem cramped
height = body.height - body.shift_amount + thickness * 5.0
depth = body.depth + body.shift_amount
- check = AutoSizedDelim(r'\sqrt', height, depth, state, always=True)
+ check = AutoHeightChar(r'\sqrt', height, depth, state, always=True)
height = check.height - check.shift_amount
depth = check.depth + check.shift_amount
@@ -2190,10 +2228,10 @@
parts = []
# \left. and \right. aren't supposed to produce any symbols
if front != '.':
- parts.append(AutoSizedDelim(front, height, depth, state))
+ parts.append(AutoHeightChar(front, height, depth, state))
parts.extend(middle.asList())
if back != '.':
- parts.append(AutoSizedDelim(back, height, depth, state))
+ parts.append(AutoHeightChar(back, height, depth, state))
hlist = Hlist(parts)
return hlist
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 15:07:32
|
Revision: 3658
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3658&view=rev
Author: mdboom
Date: 2007-08-01 08:07:29 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Change "unknown (no pkg-config)" to "found, but unknown version (no pkg-config)"
Modified Paths:
--------------
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2007-08-01 15:06:29 UTC (rev 3657)
+++ trunk/matplotlib/setupext.py 2007-08-01 15:07:29 UTC (rev 3658)
@@ -212,7 +212,7 @@
return False
def get_pkgconfig_version(package):
- default = "unknown (no pkg-config)"
+ default = "found, but unknown version (no pkg-config)"
if not has_pkgconfig():
return default
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 15:06:31
|
Revision: 3657
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3657&view=rev
Author: mdboom
Date: 2007-08-01 08:06:29 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Fix erroneous message when wxPython devel headers are not even needed.
Modified Paths:
--------------
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2007-08-01 14:22:16 UTC (rev 3656)
+++ trunk/matplotlib/setupext.py 2007-08-01 15:06:29 UTC (rev 3657)
@@ -373,7 +373,7 @@
p = os.path.join(d, 'freetype2/lib')
if os.path.exists(p): module.library_dirs.append(p)
- module.libraries.append('z')
+ module.libraries.append('z')
add_base_flags(module)
if sys.platform == 'win32' and win32_compiler == 'mingw32':
@@ -470,7 +470,10 @@
except ImportError:
explanation = 'wxPython not found'
else:
- if sys.platform == 'win32' and win32_compiler == 'mingw32':
+ if getattr(wx, '__version__', '0.0')[0:3] >= '2.8':
+ print_status("wxPython", wx.__version__)
+ return True
+ elif sys.platform == 'win32' and win32_compiler == 'mingw32':
explanation = "The wxAgg extension can not be built using the mingw32 compiler on Windows, since the default wxPython binary is built using MS Visual Studio"
else:
wxconfig = find_wx_config()
@@ -491,15 +494,14 @@
gotit = True
if gotit:
- if getattr(wx, '__version__', '0.0')[0:3] < '2.8':
- module = Extension("test", [])
- add_wx_flags(module, wxconfig)
- if not find_include_file(
- module.include_dirs,
- os.path.join("wx", "wxPython", "wxPython.h")):
- explanation = ("Could not find wxPython headers in any of %s" %
+ module = Extension("test", [])
+ add_wx_flags(module, wxconfig)
+ if not find_include_file(
+ module.include_dirs,
+ os.path.join("wx", "wxPython", "wxPython.h")):
+ explanation = ("Could not find wxPython headers in any of %s" %
", ".join(["'%s'" % x for x in module.include_dirs]))
- gotit = False
+ gotit = False
if gotit:
print_status("wxPython", wx.__version__)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 14:22:17
|
Revision: 3656
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3656&view=rev
Author: mdboom
Date: 2007-08-01 07:22:16 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Fix order of libraries between freetype2 and zlib
Modified Paths:
--------------
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2007-08-01 14:08:44 UTC (rev 3655)
+++ trunk/matplotlib/setupext.py 2007-08-01 14:22:16 UTC (rev 3656)
@@ -357,9 +357,6 @@
def add_ft2font_flags(module):
'Add the module flags to ft2font extension'
- module.libraries.append('z')
- add_base_flags(module)
-
if not get_pkgconfig(module, 'freetype2'):
module.libraries.append('freetype')
@@ -376,6 +373,9 @@
p = os.path.join(d, 'freetype2/lib')
if os.path.exists(p): module.library_dirs.append(p)
+ module.libraries.append('z')
+ add_base_flags(module)
+
if sys.platform == 'win32' and win32_compiler == 'mingw32':
module.libraries.append('gw32c')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 14:08:45
|
Revision: 3655
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3655&view=rev
Author: mdboom
Date: 2007-08-01 07:08:44 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Fix formatting display bug.
Modified Paths:
--------------
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2007-08-01 13:51:48 UTC (rev 3654)
+++ trunk/matplotlib/setupext.py 2007-08-01 14:08:44 UTC (rev 3655)
@@ -114,13 +114,13 @@
def print_status(package, status):
initial_indent = "%22s: " % package
indent = ' ' * 24
- print fill(status, width=76,
+ print fill(str(status), width=76,
initial_indent=initial_indent,
subsequent_indent=indent)
def print_message(message):
indent = ' ' * 24 + "* "
- print fill(message, width=76,
+ print fill(str(message), width=76,
initial_indent=indent,
subsequent_indent=indent)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 13:51:49
|
Revision: 3654
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3654&view=rev
Author: mdboom
Date: 2007-08-01 06:51:48 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Use Python lists rather than linked lists to improve speed
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/mathtext.py
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-08-01 13:06:07 UTC (rev 3653)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-08-01 13:51:48 UTC (rev 3654)
@@ -850,30 +850,26 @@
# Percentage of x-height of additional horiz. space after sub/superscripts
SCRIPT_SPACE = 0.3
# Percentage of x-height that sub/superscripts drop below the baseline
-SUBDROP = 0.4
+SUBDROP = 0.3
# Percentage of x-height that superscripts drop below the baseline
SUP1 = 0.7
# Percentage of x-height that subscripts drop below the baseline
SUB1 = 0.0
# Percentage of x-height that superscripts are offset relative to the subscript
-DELTA = 0.1
+DELTA = 0.25
class MathTextWarning(Warning):
pass
class Node(object):
- """A node in a linked list.
+ """A node in the TeX box model
@133
"""
def __init__(self):
- self.link = None
self.size = 0
def __repr__(self):
- s = self.__internal_repr__()
- if self.link:
- s += ' ' + self.link.__repr__()
- return s
+ return self.__internal_repr__()
def __internal_repr__(self):
return self.__class__.__name__
@@ -881,21 +877,14 @@
def get_kerning(self, next):
return 0.0
- def set_link(self, other):
- self.link = other
-
def shrink(self):
"""Shrinks one level smaller. There are only three levels of sizes,
after which things will no longer get smaller."""
- if self.link:
- self.link.shrink()
self.size += 1
def grow(self):
"""Grows one level larger. There is no limit to how big something
can get."""
- if self.link:
- self.link.grow()
self.size -= 1
def render(self, x, y):
@@ -1027,29 +1016,17 @@
def __init__(self, elements):
Box.__init__(self, 0., 0., 0.)
self.shift_amount = 0. # An arbitrary offset
- self.list_head = None # The head of a linked list of Nodes in this box
+ self.children = elements # The child nodes of this list
# The following parameters are set in the vpack and hpack functions
self.glue_set = 0. # The glue setting of this list
self.glue_sign = 0 # 0: normal, -1: shrinking, 1: stretching
self.glue_order = 0 # The order of infinity (0 - 3) for the glue
-
- # Convert the Python list to a linked list
- if len(elements):
- elem = self.list_head = elements[0]
- for next in elements[1:]:
- elem.set_link(next)
- elem = next
def __repr__(self):
- s = '[%s <%d %d %d %d> ' % (self.__internal_repr__(),
- self.width, self.height,
- self.depth, self.shift_amount)
- if self.list_head:
- s += ' ' + self.list_head.__repr__()
- s += ']'
- if self.link:
- s += ' ' + self.link.__repr__()
- return s
+ return '[%s <%d %d %d %d> %s]' % (self.__internal_repr__(),
+ self.width, self.height,
+ self.depth, self.shift_amount,
+ ' '.join(self.children))
def _determine_order(self, totals):
"""A helper function to determine the highest order of glue
@@ -1071,21 +1048,21 @@
self.glue_sign = 0
self.glue_ratio = 0.
if o == 0:
- if self.list_head is not None:
+ if len(self.children):
warn("%s %s: %r" % (error_type, self.__class__.__name__, self),
MathTextWarning)
def shrink(self):
- if self.list_head:
- self.list_head.shrink()
+ for child in self.children:
+ child.shrink()
Box.shrink(self)
if self.size < NUM_SIZE_LEVELS:
self.shift_amount *= SHRINK_FACTOR
self.glue_set *= SHRINK_FACTOR
def grow(self):
- if self.list_head:
- self.list_head.grow()
+ for child in self.children:
+ child.grow()
Box.grow(self)
self.shift_amount *= INV_SHRINK_FACTOR
self.glue_set *= INV_SHRINK_FACTOR
@@ -1103,15 +1080,21 @@
Chars themselves determine the amount of kerning they need
(in get_kerning), and this function just creates the linked
list in the correct way."""
- elem = self.list_head
- while elem is not None:
- next = elem.link
+ new_children = []
+ num_children = len(self.children)
+ for i in range(num_children):
+ elem = self.children[i]
+ if i < num_children - 1:
+ next = self.children[i + 1]
+ else:
+ next = None
+
+ new_children.append(elem)
kerning_distance = elem.get_kerning(next)
if kerning_distance != 0.:
kern = Kern(kerning_distance)
- elem.link = kern
- kern.link = next
- elem = next
+ new_children.append(kern)
+ self.children = new_children
def hpack(self, w=0., m='additional'):
"""The main duty of hpack is to compute the dimensions of the
@@ -1136,18 +1119,12 @@
x = 0.
total_stretch = [0.] * 4
total_shrink = [0.] * 4
- p = self.list_head
- while p is not None:
- # Layout characters in a tight inner loop (common case)
- while isinstance(p, Char):
+ for p in self.children:
+ if isinstance(p, Char):
x += p.width
h = max(h, p.height)
d = max(d, p.depth)
- p = p.link # Go to next node in list
- if p is None:
- break
-
- if isinstance(p, Box):
+ elif isinstance(p, Box):
x += p.width
if p.height is not None and p.depth is not None:
s = getattr(p, 'shift_amount', 0.)
@@ -1160,7 +1137,6 @@
total_shrink[glue_spec.shrink_order] += glue_spec.shrink
elif isinstance(p, Kern):
x += p.width
- p = p.link # Go to next node in list
self.height = h
self.depth = d
@@ -1207,11 +1183,8 @@
x = 0.
total_stretch = [0.] * 4
total_shrink = [0.] * 4
- p = self.list_head
- while p is not None:
- if isinstance(p, Char):
- raise RuntimeError("Internal mathtext error: Char node found in Vlist.")
- elif isinstance(p, Box):
+ for p in self.children:
+ if isinstance(p, Box):
x += d + p.height
d = p.depth
if p.width is not None:
@@ -1227,8 +1200,9 @@
elif isinstance(p, Kern):
x += d + p.width
d = 0.
- p = p.link
-
+ elif isinstance(p, Char):
+ raise RuntimeError("Internal mathtext error: Char node found in Vlist.")
+
self.width = w
if d > l:
x += d - l
@@ -1482,23 +1456,18 @@
cur_glue = 0.
glue_order = box.glue_order
glue_sign = box.glue_sign
- p = box.list_head
base_line = self.cur_v
left_edge = self.cur_h
self.cur_s += 1
self.max_push = max(self.cur_s, self.max_push)
- while p:
- while isinstance(p, Char):
+ for p in box.children:
+ if isinstance(p, Char):
p.render(self.cur_h + self.off_h, self.cur_v + self.off_v)
self.cur_h += p.width
- p = p.link
- if p is None:
- break
-
- if isinstance(p, List):
+ elif isinstance(p, List):
# @623
- if p.list_head is None:
+ if len(p.children) == 0:
self.cur_h += p.width
else:
edge = self.cur_h
@@ -1542,7 +1511,6 @@
self.cur_h += rule_width
elif isinstance(p, Kern):
self.cur_h += p.width
- p = p.link
self.cur_s -= 1
def vlist_out(self, box):
@@ -1550,18 +1518,15 @@
cur_glue = 0.
glue_order = box.glue_order
glue_sign = box.glue_sign
- p = box.list_head
self.cur_s += 1
self.max_push = max(self.max_push, self.cur_s)
left_edge = self.cur_h
self.cur_v -= box.height
top_edge = self.cur_v
- while p:
- if isinstance(p, Char):
- raise RuntimeError("Internal mathtext error: Char node found in vlist")
- elif isinstance(p, List):
- if p.list_head is None:
+ for p in box.children:
+ if isinstance(p, List):
+ if len(p.children) == 0:
self.cur_v += p.height + p.depth
else:
self.cur_v += p.height
@@ -1601,8 +1566,8 @@
self.cur_v += rule_height
elif isinstance(p, Kern):
self.cur_v += p.width
-
- p = p.link
+ elif isinstance(p, Char):
+ raise RuntimeError("Internal mathtext error: Char node found in vlist")
self.cur_s -= 1
ship = Ship()
@@ -1657,7 +1622,7 @@
_punctuation_symbols = Set(r', ; . ! \ldotp \cdotp'.split())
_overunder_symbols = Set(r'''
- \sum \prod \int \coprod \oint \bigcap \bigcup \bigsqcup \bigvee
+ \sum \prod \coprod \bigcap \bigcup \bigsqcup \bigvee
\bigwedge \bigodot \bigotimes \bigoplus \biguplus
'''.split()
)
@@ -1665,6 +1630,8 @@
_overunder_functions = Set(
r"lim liminf limsup sup max min".split()
)
+
+ _dropsub_symbols = Set(r'''\int \oint'''.split())
def __init__(self):
# All forward declarations are here
@@ -1843,6 +1810,7 @@
def clear(self):
self._expr = None
self._state_stack = None
+ self._em_width_cache = {}
def parse(self, s, fonts_object, fontsize, dpi):
self._state_stack = [self.State(fonts_object, 'default', fontsize, dpi)]
@@ -1898,10 +1866,14 @@
def _make_space(self, percentage):
# All spaces are relative to em width
state = self.get_state()
- metrics = state.font_output.get_metrics(
- state.font, 'm', state.fontsize, state.dpi)
- em = metrics.advance
- return Kern(em * percentage)
+ key = (state.font, state.fontsize, state.dpi)
+ width = self._em_width_cache.get(key)
+ if width is None:
+ metrics = state.font_output.get_metrics(
+ state.font, 'm', state.fontsize, state.dpi)
+ width = metrics.advance
+ self._em_width_cache[key] = width
+ return Kern(width * percentage)
_space_widths = { r'\ ' : 0.3,
r'\,' : 0.4,
@@ -1919,17 +1891,19 @@
def symbol(self, s, loc, toks):
# print "symbol", toks
c = toks[0]
+ try:
+ char = Char(c, self.get_state())
+ except ValueError:
+ raise ParseFatalException("Unknown symbol: %s" % c)
+
if c in self._spaced_symbols:
return [Hlist( [self._make_space(0.2),
- Char(c, self.get_state()),
+ char,
self._make_space(0.2)] )]
elif c in self._punctuation_symbols:
- return [Hlist( [Char(c, self.get_state()),
+ return [Hlist( [char,
self._make_space(0.2)] )]
- try:
- return [Char(toks[0], self.get_state())]
- except ValueError:
- raise ParseFatalException("Unknown symbol: %s" % c)
+ return [char]
_accent_map = {
r'\hat' : r'\circumflexaccent',
@@ -2004,6 +1978,11 @@
elif isinstance(nucleus, Hlist) and hasattr(nucleus, 'function_name'):
return nucleus.function_name in self._overunder_functions
return False
+
+ def is_dropsub(self, nucleus):
+ if isinstance(nucleus, Char):
+ return nucleus.c in self._dropsub_symbols
+ return False
def subsuperscript(self, s, loc, toks):
assert(len(toks)==1)
@@ -2079,7 +2058,10 @@
return [result]
shift_up = nucleus.height - SUBDROP * xHeight
- shift_down = SUBDROP * xHeight
+ if self.is_dropsub(nucleus):
+ shift_down = nucleus.depth + SUBDROP * xHeight
+ else:
+ shift_down = SUBDROP * xHeight
if super is None:
# @757
sub.shrink()
@@ -2091,8 +2073,8 @@
x.shift_amount = shift_down
else:
super.shrink()
- x = Hlist([super])
- x.width += SCRIPT_SPACE * xHeight
+ x = Hlist([super, Kern(SCRIPT_SPACE * xHeight)])
+ # x.width += SCRIPT_SPACE * xHeight
clr = SUP1 * xHeight
shift_up = max(shift_up, clr)
clr = x.depth + (abs(xHeight) / 4.0)
@@ -2104,11 +2086,11 @@
y = Hlist([sub])
y.width += SCRIPT_SPACE * xHeight
shift_down = max(shift_down, SUB1 * xHeight)
- clr = 4.0 * rule_thickness - ((shift_up - x.depth) - (y.height - shift_down))
+ clr = 2.0 * rule_thickness - ((shift_up - x.depth) - (y.height - shift_down))
if clr > 0.:
shift_up += clr
shift_down += clr
- x.shift_amount = DELTA * xHeight
+ x.shift_amount = DELTA * (shift_up + shift_down)
x = Vlist([x,
Kern((shift_up - x.depth) - (y.height - shift_down)),
y])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 13:06:12
|
Revision: 3653
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3653&view=rev
Author: mdboom
Date: 2007-08-01 06:06:07 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Removing test code
Modified Paths:
--------------
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2007-08-01 13:03:00 UTC (rev 3652)
+++ trunk/matplotlib/setupext.py 2007-08-01 13:06:07 UTC (rev 3653)
@@ -193,7 +193,6 @@
status, output = commands.getstatusoutput(
"%s %s %s" % (pkg_config_exec, flags, packages))
if status == 0:
- output += ' -UFOO'
for token in output.split():
attr = _flags.get(token[:2], None)
if attr is not None:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 13:03:02
|
Revision: 3652
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3652&view=rev
Author: mdboom
Date: 2007-08-01 06:03:00 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Fix handling of def/undef macros
Modified Paths:
--------------
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2007-08-01 12:41:17 UTC (rev 3651)
+++ trunk/matplotlib/setupext.py 2007-08-01 13:03:00 UTC (rev 3652)
@@ -193,12 +193,19 @@
status, output = commands.getstatusoutput(
"%s %s %s" % (pkg_config_exec, flags, packages))
if status == 0:
+ output += ' -UFOO'
for token in output.split():
attr = _flags.get(token[:2], None)
if attr is not None:
+ if token[:2] == '-D':
+ value = tuple(token[2:].split('='))
+ if len(value) == 1:
+ value = (value[0], None)
+ else:
+ value = token[2:]
set = getattr(module, attr)
- if token[2:] not in set:
- set.append(token[2:])
+ if value not in set:
+ set.append(value)
else:
if token not in module.extra_link_args:
module.extra_link_args.append(token)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 12:41:21
|
Revision: 3651
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3651&view=rev
Author: mdboom
Date: 2007-08-01 05:41:17 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Fix wxagg building for earlier versions of wx
Modified Paths:
--------------
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2007-08-01 12:28:24 UTC (rev 3650)
+++ trunk/matplotlib/setupext.py 2007-08-01 12:41:17 UTC (rev 3651)
@@ -810,6 +810,7 @@
add_agg_flags(module)
add_ft2font_flags(module)
+ wxconfig = find_wx_config()
add_wx_flags(module, wxconfig)
ext_modules.append(module)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 12:28:25
|
Revision: 3650
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3650&view=rev
Author: mdboom
Date: 2007-08-01 05:28:24 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Display Python version information in status header
Modified Paths:
--------------
trunk/matplotlib/setup.py
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py 2007-08-01 12:26:55 UTC (rev 3649)
+++ trunk/matplotlib/setup.py 2007-08-01 12:28:24 UTC (rev 3650)
@@ -116,6 +116,7 @@
print_line()
print_raw("BUILDING MATPLOTLIB")
print_status('matplotlib', '%s (r%s)' % (__version__, __revision__.split()[-2]))
+print_status('python', sys.version)
print_status('platform', sys.platform)
if sys.platform == 'win32':
print_status('Windows version', sys.getwindowsversion())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 12:26:56
|
Revision: 3649
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3649&view=rev
Author: mdboom
Date: 2007-08-01 05:26:55 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Fix wx check and build
Modified Paths:
--------------
trunk/matplotlib/setup.py
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py 2007-08-01 12:19:03 UTC (rev 3648)
+++ trunk/matplotlib/setup.py 2007-08-01 12:26:55 UTC (rev 3649)
@@ -238,7 +238,7 @@
if check_for_wx() and BUILD_WXAGG:
BUILD_AGG = 1
import wx
- if wx.__version__ < (2.8):
+ if getattr(wx, '__version__', '0.0')[0:3] < '2.8':
build_wxagg(ext_modules, packages)
wxagg_backend_status = "yes"
else:
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2007-08-01 12:19:03 UTC (rev 3648)
+++ trunk/matplotlib/setupext.py 2007-08-01 12:26:55 UTC (rev 3649)
@@ -485,14 +485,15 @@
gotit = True
if gotit:
- module = Extension("test", [])
- add_wx_flags(module, wxconfig)
- if not find_include_file(
- module.include_dirs,
- os.path.join("wx", "wxPython", "wxPython.h")):
- explanation = ("Could not find wxPython headers in any of %s" %
- ", ".join(["'%s'" % x for x in module.include_dirs]))
- gotit = False
+ if getattr(wx, '__version__', '0.0')[0:3] < '2.8':
+ module = Extension("test", [])
+ add_wx_flags(module, wxconfig)
+ if not find_include_file(
+ module.include_dirs,
+ os.path.join("wx", "wxPython", "wxPython.h")):
+ explanation = ("Could not find wxPython headers in any of %s" %
+ ", ".join(["'%s'" % x for x in module.include_dirs]))
+ gotit = False
if gotit:
print_status("wxPython", wx.__version__)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 12:19:06
|
Revision: 3648
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3648&view=rev
Author: mdboom
Date: 2007-08-01 05:19:03 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Earlier versions of pygtk don't have a pygobject version
Modified Paths:
--------------
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2007-08-01 12:15:03 UTC (rev 3647)
+++ trunk/matplotlib/setupext.py 2007-08-01 12:19:03 UTC (rev 3648)
@@ -409,9 +409,13 @@
if gotit:
import gobject
+ if hasattr(gobject, 'pygobject_version'):
+ pygobject_version = ver2str(gobject.pygobject_version)
+ else:
+ pygobject_version = '[pre-pygobject]'
print_status("Gtk+", "gtk+: %s, glib: %s, pygtk: %s, pygobject: %s" %
(ver2str(gtk.gtk_version), ver2str(gobject.glib_version),
- ver2str(gtk.pygtk_version), ver2str(gobject.pygobject_version)))
+ ver2str(gtk.pygtk_version), pygobject_version))
else:
print_status("Gtk+", "no")
print_message(explanation)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-08-01 12:15:06
|
Revision: 3647
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3647&view=rev
Author: mdboom
Date: 2007-08-01 05:15:03 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
Don't import commands if running on Windows
Modified Paths:
--------------
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2007-07-31 18:42:39 UTC (rev 3646)
+++ trunk/matplotlib/setupext.py 2007-08-01 12:15:03 UTC (rev 3647)
@@ -60,7 +60,8 @@
}
import sys, os, stat
-import commands
+if sys.platform != 'win32':
+ import commands
from sets import Set
from textwrap import fill
from distutils.core import Extension
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-07-31 18:42:46
|
Revision: 3646
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3646&view=rev
Author: mdboom
Date: 2007-07-31 11:42:39 -0700 (Tue, 31 Jul 2007)
Log Message:
-----------
Refactor distutils script to display information about the extensions
being built. Use pkg-config to find freetype if possible.
Modified Paths:
--------------
trunk/matplotlib/setup.cfg
trunk/matplotlib/setup.py
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/setup.cfg
===================================================================
--- trunk/matplotlib/setup.cfg 2007-07-31 14:05:01 UTC (rev 3645)
+++ trunk/matplotlib/setup.cfg 2007-07-31 18:42:39 UTC (rev 3646)
@@ -1,2 +1,7 @@
[egg_info]
tag_svn_revision = 1
+
+[status]
+# To suppress display of the dependencies and their versions
+# at the top of the build log, uncomment the following line:
+# suppress = 1
\ No newline at end of file
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py 2007-07-31 14:05:01 UTC (rev 3645)
+++ trunk/matplotlib/setup.py 2007-07-31 18:42:39 UTC (rev 3646)
@@ -35,7 +35,7 @@
# build wxPython extension code to efficiently blit agg into wx. Only
# needed for wxpython <2.8 if you plan on doing animations
-BUILD_WXAGG = 0
+BUILD_WXAGG = 1
# build a small extension to manage the focus on win32 platforms.
@@ -71,18 +71,57 @@
setuptools requirement, you must delete the old matplotlib install
directory.""")
+if major==2 and minor1<3 or major<2:
+ raise SystemExit("""matplotlib requires Python 2.3 or later.""")
+
import glob
from distutils.core import setup
from setupext import build_agg, build_gtkagg, build_tkagg, build_wxagg,\
build_ft2font, build_image, build_windowing, build_transforms, \
build_contour, build_nxutils, build_enthought, build_swigagg, build_gdk, \
- build_subprocess, build_ttconv
+ build_subprocess, build_ttconv, print_line, print_status, print_message, \
+ print_raw, check_for_freetype, check_for_libpng, check_for_gtk, check_for_tk, \
+ check_for_wx, check_for_numpy, check_for_qt, check_for_qt4, check_for_cairo
#import distutils.sysconfig
+# jdh
+packages = [
+ 'matplotlib',
+ 'matplotlib.backends',
+ 'matplotlib.toolkits',
+ 'matplotlib.numerix',
+ 'matplotlib.numerix.mlab',
+ 'matplotlib.numerix.ma',
+ 'matplotlib.numerix.npyma',
+ 'matplotlib.numerix.linear_algebra',
+ 'matplotlib.numerix.random_array',
+ 'matplotlib.numerix.fft',
+ 'matplotlib.config'
+ ]
+
+ext_modules = []
+
+# these are not optional
+BUILD_FT2FONT = 1
+BUILD_TTCONV = 1
+BUILD_CONTOUR = 1
+BUILD_NXUTILS = 1
+
for line in file('lib/matplotlib/__init__.py').readlines():
- if line[:11] == '__version__':
+ if (line.startswith('__version__') or
+ line.startswith('__revision__') or
+ line.startswith('__date__')):
exec(line.strip())
+print_line()
+print_raw("BUILDING MATPLOTLIB")
+print_status('matplotlib', '%s (r%s)' % (__version__, __revision__.split()[-2]))
+print_status('platform', sys.platform)
+if sys.platform == 'win32':
+ print_status('Windows version', sys.getwindowsversion())
+print_raw("")
+print_raw("REQUIRED DEPENDENCIES")
+
# Specify all the required mpl data
package_data = {'matplotlib':['mpl-data/fonts/afm/*.afm',
'mpl-data/fonts/pdfcorefonts/*.afm',
@@ -98,43 +137,19 @@
'backends/Matplotlib.nib/*',
]}
+if not check_for_numpy():
+ sys.exit()
+
# The NUMERIX variable (a list) is left over from the days when it had
# a string for each of the supported backends. Now there is only one
# supported backend, so this approach could (should?) get changed for
# simplicity.
-try:
- import numpy
- NUMERIX = ['numpy']
-except ImportError:
- raise RuntimeError("You must install numpy to build matplotlib")
+import numpy
+NUMERIX = ['numpy']
rc['numerix'] = NUMERIX[-1]
-ext_modules = []
-
-# these are not optional
-BUILD_FT2FONT = 1
-BUILD_TTCONV = 1
-BUILD_CONTOUR = 1
-BUILD_NXUTILS = 1
-
-# jdh
-packages = [
- 'matplotlib',
- 'matplotlib.backends',
- 'matplotlib.toolkits',
- 'matplotlib.numerix',
- 'matplotlib.numerix.mlab',
- 'matplotlib.numerix.ma',
- 'matplotlib.numerix.npyma',
- 'matplotlib.numerix.linear_algebra',
- 'matplotlib.numerix.random_array',
- 'matplotlib.numerix.fft',
- 'matplotlib.config'
- ]
-
-
try: import subprocess
except ImportError: havesubprocess = False
else: havesubprocess = True
@@ -146,12 +161,28 @@
subprocess_dir = os.path.dirname(subprocess.__file__)
if subprocess_dir.endswith('.egg/subprocess'):
havesubprocess = False
-
+
if not havesubprocess:
packages.append('subprocess')
if sys.platform == 'win32':
build_subprocess(ext_modules, packages)
+if not check_for_freetype():
+ sys.exit(1)
+
+if BUILD_FT2FONT:
+ build_ft2font(ext_modules, packages)
+
+if BUILD_TTCONV:
+ build_ttconv(ext_modules, packages)
+
+if 1: # I don't think we need to make these optional
+ build_contour(ext_modules, packages)
+ build_nxutils(ext_modules, packages)
+
+print_raw("")
+print_raw("OPTIONAL DEPENDENCIES")
+
try: import datetime
except ImportError: havedate = False
else: havedate = True
@@ -174,115 +205,70 @@
add_dateutil()
else:
# only add them if we need them
- try: import dateutil
- except ImportError:
- add_dateutil()
- try: import pytz
+ try:
+ import pytz
except ImportError:
add_pytz()
+ try:
+ import dateutil
+ except ImportError:
+ add_dateutil()
+
build_swigagg(ext_modules, packages)
build_transforms(ext_modules, packages)
build_enthought(ext_modules, packages)
-def havegtk():
- 'check for the presence of pygtk'
- if havegtk.gotit is not None: return havegtk.gotit
- try:
- import gtk
- except ImportError:
- print 'building for GTK requires pygtk; you must be able to "import gtk" in your build/install environment'
- havegtk.gotit = False
- except RuntimeError:
- print 'pygtk present but import failed'
- havegtk.gotit = False
- else:
- version = (2,2,0)
- if gtk.pygtk_version < version:
- print "Error: GTK backend requires PyGTK %d.%d.%d (or later), " \
- "%d.%d.%d was detected." % (
- version + gtk.pygtk_version)
- havegtk.gotit = False
- else:
- havegtk.gotit = True
- return havegtk.gotit
+if check_for_gtk() and (BUILD_GTK or BUILD_GTKAGG):
+ if BUILD_GTK:
+ build_gdk(ext_modules, packages)
+ rc['backend'] = 'GTK'
+ if BUILD_GTKAGG:
+ BUILD_AGG = 1
+ build_gtkagg(ext_modules, packages)
+ rc['backend'] = 'GTKAgg'
-havegtk.gotit = None
-
-if BUILD_GTK and havegtk():
- build_gdk(ext_modules, packages)
- rc['backend'] = 'GTK'
-
-if BUILD_GTKAGG and havegtk():
+if check_for_tk() and BUILD_TKAGG:
BUILD_AGG = 1
- build_gtkagg(ext_modules, packages)
- rc['backend'] = 'GTKAgg'
+ build_tkagg(ext_modules, packages)
+ rc['backend'] = 'TkAgg'
-if BUILD_TKAGG:
- try:
- import Tkinter
- except ImportError:
- print 'TKAgg requires TkInter'
- BUILD_TKAGG = 0
- except RuntimeError:
- print 'Tkinter present but import failed'
- BUILD_TKAGG = 0
+explanation = None
+if check_for_wx() and BUILD_WXAGG:
+ BUILD_AGG = 1
+ import wx
+ if wx.__version__ < (2.8):
+ build_wxagg(ext_modules, packages)
+ wxagg_backend_status = "yes"
else:
- try:
- tk = Tkinter.Tk()
- tk.withdraw()
- except Tkinter.TclError:
- print 'Tkinter present, but window failed to open'
- BUILD_TKAGG = 0
- else:
- BUILD_AGG = 1
- build_tkagg(ext_modules, packages)
- rc['backend'] = 'TkAgg'
+ print_message("WxAgg extension not required for wxPython < 2.8")
+ rc['backend'] = 'WXAgg'
-if BUILD_WXAGG:
- try:
- import wx
- except ImportError:
- if BUILD_WXAGG != 'auto':
- print 'WXAgg\'s accelerator requires wxPython'
- BUILD_WXAGG = 0
- else:
- if getattr(wx, '__version__', '0.0')[0:3] < '2.8':
- BUILD_AGG = 1
- build_wxagg(ext_modules, packages,
- not (isinstance(BUILD_WXAGG, str) # don't abort if BUILD_WXAGG
- and BUILD_WXAGG.lower() == 'auto')) # is "auto"
- rc['backend'] = 'WXAgg'
-
-if BUILD_AGG:
+# These are informational only. We don't build
+# any extensions for them.
+check_for_qt()
+check_for_qt4()
+check_for_cairo()
+
+if check_for_libpng() and BUILD_AGG:
build_agg(ext_modules, packages)
if rc['backend'] == 'PS': rc['backend'] = 'Agg'
-
-
-if BUILD_FT2FONT:
- build_ft2font(ext_modules, packages)
-
-if BUILD_TTCONV:
- build_ttconv(ext_modules, packages)
-
if BUILD_WINDOWING and sys.platform=='win32':
build_windowing(ext_modules, packages)
if BUILD_IMAGE:
build_image(ext_modules, packages)
-if 1: # I don't think we need to make these optional
- build_contour(ext_modules, packages)
- build_nxutils(ext_modules, packages)
-
for mod in ext_modules:
if VERBOSE:
mod.extra_compile_args.append('-DVERBOSE')
+print_raw("")
+print_raw("[Edit setup.cfg to suppress the above messages]")
+print_line()
-
# packagers: set rc['numerix'] and rc['backend'] here to override the auto
# defaults, eg
#rc['numerix'] = numpy
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2007-07-31 14:05:01 UTC (rev 3645)
+++ trunk/matplotlib/setupext.py 2007-07-31 18:42:39 UTC (rev 3646)
@@ -60,8 +60,12 @@
}
import sys, os, stat
+import commands
+from sets import Set
+from textwrap import fill
from distutils.core import Extension
import glob
+import ConfigParser
major, minor1, minor2, s, tmp = sys.version_info
if major<2 or (major==2 and minor1<3):
@@ -81,7 +85,7 @@
BUILT_WINDOWING = False
BUILT_CONTOUR = False
BUILT_NXUTILS = False
-BUILT_ENTHOUGHT = False
+BUILT_ENTHOUGHT = False
BUILT_CONTOUR = False
BUILT_GDK = False
@@ -90,6 +94,42 @@
# for nonstandard installation/build with --prefix variable
numpy_inc_dirs = []
+# Based on the contents of setup.cfg, determine if the status block
+# should be displayed
+display_status = True
+if os.path.exists("setup.cfg"):
+ config = ConfigParser.SafeConfigParser()
+ config.read("setup.cfg")
+ try:
+ if config.get("status", "suppress"):
+ display_status = False
+ except:
+ pass
+
+if display_status:
+ def print_line(char='='):
+ print char * 76
+
+ def print_status(package, status):
+ initial_indent = "%22s: " % package
+ indent = ' ' * 24
+ print fill(status, width=76,
+ initial_indent=initial_indent,
+ subsequent_indent=indent)
+
+ def print_message(message):
+ indent = ' ' * 24 + "* "
+ print fill(message, width=76,
+ initial_indent=indent,
+ subsequent_indent=indent)
+
+ def print_raw(section):
+ print section
+else:
+ def print_line(*args, **kwargs):
+ pass
+ print_status = print_message = print_raw = print_line
+
class CleanUpFile:
"""CleanUpFile deletes the specified filename when self is destroyed."""
def __init__(self, name):
@@ -123,8 +163,99 @@
else:
std_libs = ['stdc++', 'm']
+def has_pkgconfig():
+ if has_pkgconfig.cache is not None:
+ return has_pkgconfig.cache
+ if sys.platform == 'win32':
+ has_pkgconfig.cache = False
+ else:
+ status, output = commands.getstatusoutput("pkg-config --help")
+ has_pkgconfig.cache = (status == 0)
+ return has_pkgconfig.cache
+has_pkgconfig.cache = None
+
+def get_pkgconfig(module,
+ packages,
+ flags="--libs --cflags",
+ pkg_config_exec='pkg-config'):
+ """Loosely based on an article in the Python Cookbook:
+ http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502261"""
+ if not has_pkgconfig():
+ return False
+
+ _flags = {'-I': 'include_dirs',
+ '-L': 'library_dirs',
+ '-l': 'libraries',
+ '-D': 'define_macros',
+ '-U': 'undef_macros'}
+
+ status, output = commands.getstatusoutput(
+ "%s %s %s" % (pkg_config_exec, flags, packages))
+ if status == 0:
+ for token in output.split():
+ attr = _flags.get(token[:2], None)
+ if attr is not None:
+ set = getattr(module, attr)
+ if token[2:] not in set:
+ set.append(token[2:])
+ else:
+ if token not in module.extra_link_args:
+ module.extra_link_args.append(token)
+ return True
+ return False
+
+def get_pkgconfig_version(package):
+ default = "unknown (no pkg-config)"
+ if not has_pkgconfig():
+ return default
+
+ status, output = commands.getstatusoutput(
+ "pkg-config %s --modversion" % (package))
+ if status == 0:
+ return output
+ return default
+
+def try_pkgconfig(module, package, fallback):
+ if not get_pkgconfig(module, package):
+ module.libraries.append(fallback)
+
+def find_include_file(include_dirs, filename):
+ for d in include_dirs:
+ if os.path.exists(os.path.join(d, filename)):
+ return True
+ return False
+
+def check_for_freetype():
+ module = Extension('test', [])
+ add_base_flags(module)
+ if not get_pkgconfig(module, 'freetype2'):
+ basedirs = module.include_dirs[:] # copy the list to avoid inf loop!
+ for d in basedirs:
+ module.include_dirs.append(os.path.join(d, 'freetype2'))
+
+ if not find_include_file(module.include_dirs, 'ft2build.h'):
+ print_message(
+ "Could not find 'freetype2' headers in any of %s" %
+ ", ".join(["'%s'" % x for x in module.include_dirs]))
+ return False
+
+ print_status("freetype2", get_pkgconfig_version('freetype2'))
+ return True
+
+def check_for_libpng():
+ module = Extension("test", [])
+ get_pkgconfig(module, 'libpng')
+ add_base_flags(module)
+ if not find_include_file(module.include_dirs, 'png.h'):
+ print_message(
+ ", ".join("Could not find 'libpng' headers in any of %s" %
+ ["'%s'" % x for x in module.include_dirs]))
+ return False
+
+ print_status("libpng", get_pkgconfig_version('libpng'))
+ return True
+
def add_base_flags(module):
-
incdirs = filter(os.path.exists,
[os.path.join(p, 'include') for p in basedir[sys.platform] ])
libdirs = filter(os.path.exists,
@@ -141,6 +272,57 @@
ret = os.popen(s).read().strip()
return ret
+def check_for_qt():
+ try:
+ import pyqtconfig
+ except ImportError:
+ print_status("Qt", "no")
+ return False
+ else:
+ print_status("Qt", "Qt: %s, pyqt: %s" %
+ (pyqtconfig.Configuration().pyqt_version_str,
+ pyqtconfig.Configuration().qt_version))
+ return True
+
+def check_for_qt4():
+ try:
+ import PyQt4.pyqtconfig
+ except ImportError:
+ print_status("Qt4", "no")
+ return False
+ else:
+ print_status("Qt4", "Qt: %s, pyqt: %s" %
+ (PyQt4.pyqtconfig.Configuration().pyqt_version_str,
+ PyQt4.pyqtconfig.Configuration().qt_version))
+ return True
+
+def check_for_cairo():
+ try:
+ import cairo
+ except ImportError:
+ print_status("Cairo", "no")
+ return False
+ else:
+ print_status("Cairo", cairo.version)
+
+def check_for_numpy():
+ gotit = False
+ try:
+ import numpy
+ except ImportError:
+ print_status("numpy", "no")
+ print_message("You must install numpy to build matplotlib.")
+ return False
+ module = Extension('test', [])
+ add_numpy_flags(module)
+ add_base_flags(module)
+ if not find_include_file(module.include_dirs, os.path.join("numpy", "arrayobject.h")):
+ print_status("numpy", "no")
+ print_message("Could not find the headers for numpy. You may need to install the development package.")
+ return False
+ print_status("numpy", numpy.__version__)
+ return True
+
def add_numpy_flags(module):
"Add the modules flags to build extensions which use numpy"
import numpy
@@ -154,13 +336,11 @@
'Add the module flags to build extensions which use agg'
# before adding the freetype flags since -z comes later
- module.libraries.append('png')
+ try_pkgconfig(module, 'libpng', 'png')
module.libraries.append('z')
add_base_flags(module)
module.include_dirs.extend(['src','swig', '%s/include'%AGG_VERSION, '.'])
-
-
# put these later for correct link order
module.libraries.extend(std_libs)
@@ -168,24 +348,26 @@
'Add the module flags to build extensions which use gd'
module.libraries.append('gd')
-
def add_ft2font_flags(module):
- 'Add the module flags to build extensions which use gd'
- module.libraries.extend(['freetype', 'z' ])
+ 'Add the module flags to ft2font extension'
+ module.libraries.append('z')
add_base_flags(module)
- basedirs = module.include_dirs[:] # copy the list to avoid inf loop!
- for d in basedirs:
- module.include_dirs.append(os.path.join(d, 'freetype2'))
- p = os.path.join(d, 'lib/freetype2/include')
- if os.path.exists(p): module.include_dirs.append(p)
- p = os.path.join(d, 'lib/freetype2/include/freetype2')
- if os.path.exists(p): module.include_dirs.append(p)
+ if not get_pkgconfig(module, 'freetype2'):
+ module.libraries.append('freetype')
+
+ basedirs = module.include_dirs[:] # copy the list to avoid inf loop!
+ for d in basedirs:
+ module.include_dirs.append(os.path.join(d, 'freetype2'))
+ p = os.path.join(d, 'lib/freetype2/include')
+ if os.path.exists(p): module.include_dirs.append(p)
+ p = os.path.join(d, 'lib/freetype2/include/freetype2')
+ if os.path.exists(p): module.include_dirs.append(p)
- basedirs = module.library_dirs[:] # copy the list to avoid inf loop!
- for d in basedirs:
- p = os.path.join(d, 'freetype2/lib')
- if os.path.exists(p): module.library_dirs.append(p)
+ basedirs = module.library_dirs[:] # copy the list to avoid inf loop!
+ for d in basedirs:
+ p = os.path.join(d, 'freetype2/lib')
+ if os.path.exists(p): module.library_dirs.append(p)
if sys.platform == 'win32' and win32_compiler == 'mingw32':
module.libraries.append('gw32c')
@@ -193,8 +375,48 @@
# put this last for library link order
module.libraries.extend(std_libs)
+def check_for_gtk():
+ 'check for the presence of pygtk'
+ gotit = False
+ explanation = None
+ try:
+ import gtk
+ except ImportError:
+ explanation = 'Building for Gtk+ requires pygtk; you must be able to "import gtk" in your build/install environment'
+ except RuntimeError:
+ explanation = 'pygtk present but import failed'
+ else:
+ version = (2,2,0)
+ if gtk.pygtk_version < version:
+ explanation = "Error: GTK backend requires PyGTK %d.%d.%d (or later), " \
+ "%d.%d.%d was detected." % (
+ version + gtk.pygtk_version)
+ else:
+ gotit = True
+ if gotit:
+ module = Extension('test', [])
+ add_pygtk_flags(module)
+ if not find_include_file(module.include_dirs, os.path.join("gtk", "gtk.h")):
+ explanation = (
+ "Could not find Gtk+ headers in any of %s" %
+ ", ".join(["'%s'" % x for x in module.include_dirs]))
+ gotit = False
+ def ver2str(tup):
+ return ".".join([str(x) for x in tup])
+
+ if gotit:
+ import gobject
+ print_status("Gtk+", "gtk+: %s, glib: %s, pygtk: %s, pygobject: %s" %
+ (ver2str(gtk.gtk_version), ver2str(gobject.glib_version),
+ ver2str(gtk.pygtk_version), ver2str(gobject.pygobject_version)))
+ else:
+ print_status("Gtk+", "no")
+ print_message(explanation)
+
+ return gotit
+
def add_pygtk_flags(module):
'Add the module flags to build extensions which use gtk'
@@ -220,36 +442,61 @@
add_base_flags(module)
- # set for msvc compiler if not present
- if not os.environ.has_key('PKG_CONFIG_PATH'):
- os.environ['PKG_CONFIG_PATH'] = 'C:\GTK\lib\pkgconfig'
+ if sys.platform != 'win32':
+ # If Gtk+ is installed, pkg-config is required to be installed
+ get_pkgconfig(module, 'pygtk-2.0 gtk+-2.0')
- pygtkIncludes = getoutput('pkg-config --cflags-only-I pygtk-2.0').split()
- gtkIncludes = getoutput('pkg-config --cflags-only-I gtk+-2.0').split()
- includes = pygtkIncludes + gtkIncludes
- module.include_dirs.extend([include[2:] for include in includes])
+ # visual studio doesn't need the math library
+ if sys.platform == 'win32' and win32_compiler == 'msvc' and 'm' in module.libraries:
+ module.libraries.remove('m')
- pygtkLinker = getoutput('pkg-config --libs pygtk-2.0').split()
- gtkLinker = getoutput('pkg-config --libs gtk+-2.0').split()
- linkerFlags = pygtkLinker + gtkLinker
- module.libraries.extend(
- [flag[2:] for flag in linkerFlags if flag.startswith('-l')])
+def check_for_wx():
+ gotit = False
+ explanation = None
+ try:
+ import wx
+ except ImportError:
+ explanation = 'wxPython not found'
+ else:
+ if sys.platform == 'win32' and win32_compiler == 'mingw32':
+ explanation = "The wxAgg extension can not be built using the mingw32 compiler on Windows, since the default wxPython binary is built using MS Visual Studio"
+ else:
+ wxconfig = find_wx_config()
+ if wxconfig is None:
+ explanation = """
+WXAgg's accelerator requires `wx-config'.
+The `wx-config\' executable could not be located in any directory of the
+PATH environment variable. If you want to build WXAgg, and wx-config is
+in some other location or has some other name, set the WX_CONFIG
+environment variable to the full path of the executable like so:
- module.library_dirs.extend(
- [flag[2:] for flag in linkerFlags if flag.startswith('-L')])
+export WX_CONFIG=/usr/lib/wxPython-2.6.1.0-gtk2-unicode/bin/wx-config
+"""
+ elif not check_wxpython_broken_macosx104_version(wxconfig):
+ explanation = 'WXAgg\'s accelerator not building because a broken wxPython (installed by Apple\'s Mac OS X) was found.'
+ else:
+ gotit = True
+ if gotit:
+ module = Extension("test", [])
+ add_wx_flags(module, wxconfig)
+ if not find_include_file(
+ module.include_dirs,
+ os.path.join("wx", "wxPython", "wxPython.h")):
+ explanation = ("Could not find wxPython headers in any of %s" %
+ ", ".join(["'%s'" % x for x in module.include_dirs]))
+ gotit = False
- module.extra_link_args.extend(
- [flag for flag in linkerFlags if not
- (flag.startswith('-l') or flag.startswith('-L'))])
-
- # visual studio doesn't need the math library
- if sys.platform == 'win32' and win32_compiler == 'msvc' and 'm' in module.libraries:
- module.libraries.remove('m')
-
-
+ if gotit:
+ print_status("wxPython", wx.__version__)
+ else:
+ print_status("wxPython", "no")
+ if explanation is not None:
+ print_message(explanation)
+ return gotit
+
def find_wx_config():
"""If the WX_CONFIG environment variable has been set, returns it value.
Otherwise, search for `wx-config' in the PATH directories and return the
@@ -268,24 +515,6 @@
return None
-
-def check_wxpython_headers(wxconfig):
- """Determines if wxPython.h can be found in one of the wxWidgets include
- directories.
- """
-
- flags = getoutput(wxconfig + ' --cppflags').split()
- incdirs = [os.path.join(p, 'include') for p in basedir[sys.platform]
- if os.path.exists(p)]
-
- incdirs += [x[2:] for x in flags if x.startswith('-I')]
- header = os.path.join('wx', 'wxPython', 'wxPython.h')
-
- for d in incdirs:
- if os.path.exists(os.path.join(d, header)):
- return True
- return False
-
def check_wxpython_broken_macosx104_version(wxconfig):
"""Determines if we're using a broken wxPython installed by Mac OS X 10.4"""
if sys.platform == 'darwin':
@@ -308,31 +537,8 @@
module.libraries.extend(wxlibs)
return
- def getWX(fmt, *args):
- return getoutput(wxconfig + ' ' + (fmt % args)).split()
+ get_pkgconfig(module, '', flags='--cppflags --libs', pkg_config_exec='wx-config')
- wxFlags = getWX('--cppflags')
- wxLibs = getWX('--libs')
-
-
- add_base_flags(module)
- module.include_dirs.extend(
- [x[2:] for x in wxFlags if x.startswith('-I')])
-
-
- module.define_macros.extend(
- [(x[2:], None) for x in wxFlags if x.startswith('-D')])
- module.undef_macros.extend(
- [x[2:] for x in wxFlags if x.startswith('-U')])
-
- module.libraries.extend(
- [x[2:] for x in wxLibs if x.startswith('-l')])
- module.library_dirs.extend(
- [x[2:] for x in wxLibs if x.startswith('-L')])
- module.extra_link_args.extend(
- [x for x in wxLibs if not (x.startswith('-l') or x.startswith('-L'))])
-
-
# Make sure you use the Tk version given by Tkinter.TkVersion
# or else you'll build for a wrong version of the Tcl
# interpreter (leading to nasty segfaults).
@@ -342,21 +548,12 @@
def find_tcltk():
"""Finds Tcl/Tk includes/libraries/version by interrogating Tkinter."""
- try:
- import Tkinter
- except:
- print "Tkinter not properly installed\n"
- sys.exit(1)
- if Tkinter.TkVersion < 8.3:
- print "Tcl/Tk v8.3 or later required\n"
- sys.exit(1)
+ # By this point, we already know that Tkinter imports correctly
+ import Tkinter
o = FoundTclTk()
try:
tk=Tkinter.Tk()
except Tkinter.TclError:
- print "Using default library and include directories for Tcl and Tk because a"
- print "Tk window failed to open. You may need to define DISPLAY for Tk to work"
- print "so that setup can determine where your libraries are located."
o.tcl_lib = "/usr/local/lib"
o.tcl_inc = "/usr/local/include"
o.tk_lib = "/usr/local/lib"
@@ -389,24 +586,60 @@
os.path.exists('/usr/include/tk.h')):
o.tcl_inc = '/usr/include/'
o.tk_inc = '/usr/include/'
-
- if not os.path.exists(o.tcl_inc):
- print 'cannot find tcl/tk headers. giving up.'
- sys.exit()
return o
+def check_for_tk():
+ gotit = False
+ explanation = None
+ try:
+ import Tkinter
+ except ImportError:
+ explanation = 'TKAgg requires Tkinter'
+ except RuntimeError:
+ explanation = 'Tkinter present but import failed'
+ else:
+ if Tkinter.TkVersion < 8.3:
+ explanation = "Tcl/Tk v8.3 or later required\n"
+ sys.exit(1)
+ else:
+ try:
+ tk = Tkinter.Tk()
+ tk.withdraw()
+ except Tkinter.TclError:
+ explanation = """\
+Using default library and include directories for Tcl and Tk because a
+Tk window failed to open. You may need to define DISPLAY for Tk to work
+so that setup can determine where your libraries are located."""
+ gotit = True
+ if gotit:
+ module = Extension('test', [])
+ try:
+ add_tk_flags(module)
+ except RuntimeError, e:
+ explanation = str(e)
+ gotit = False
+ if not find_include_file(module.include_dirs, "tk.h"):
+ explanation = 'Tkinter present, but header files are not installed. You may need to install development packages.'
+ gotit = False
+
+ if gotit:
+ print_status("Tkinter", "Tkinter: %s, Tk: %s, Tcl: %s" %
+ (Tkinter.__version__.split()[-2], Tkinter.TkVersion, Tkinter.TclVersion))
+ else:
+ print_status("Tkinter", "no")
+ if explanation is not None:
+ print_message(explanation)
+ return gotit
+
def add_tk_flags(module):
'Add the module flags to build extensions which use tk'
if sys.platform=='win32':
major, minor1, minor2, s, tmp = sys.version_info
- print 'building tkagg', major, minor1
if major==2 and minor1 in [3, 4, 5]:
- print '\tBuilding for python2%d'%minor1
module.include_dirs.extend(['win32_static/include/tcl84'])
module.libraries.extend(['tk84', 'tcl84'])
elif major==2 and minor1==2:
- print '\tBuilding for python22'
module.include_dirs.extend(['win32_static/include/tcl83'])
module.libraries.extend(['tk83', 'tcl83'])
else:
@@ -503,7 +736,10 @@
def build_ttconv(ext_modules, packages):
global BUILT_TTCONV
if BUILT_TTCONV: return # only build it if you you haven't already
- deps = ['src/_ttconv.cpp', 'ttconv/pprdrv_tt.cpp', 'ttconv/pprdrv_tt2.cpp', 'ttconv/ttutil.cpp']
+ deps = ['src/_ttconv.cpp',
+ 'ttconv/pprdrv_tt.cpp',
+ 'ttconv/pprdrv_tt2.cpp',
+ 'ttconv/ttutil.cpp']
deps.extend(glob.glob('CXX/*.cxx'))
deps.extend(glob.glob('CXX/*.c'))
@@ -523,11 +759,9 @@
deps,
)
-
# add agg flags before pygtk because agg only supports freetype1
# and pygtk includes freetype2. This is a bit fragile.
-
add_agg_flags(module)
add_ft2font_flags(module)
add_pygtk_flags(module)
@@ -557,62 +791,11 @@
BUILT_TKAGG = True
-def build_wxagg(ext_modules, packages, abortOnFailure):
+def build_wxagg(ext_modules, packages):
global BUILT_WXAGG
if BUILT_WXAGG:
return
- wxconfig = find_wx_config()
-
- # Avoid aborting the whole build process if `wx-config' can't be found and
- # BUILD_WXAGG in setup.py is set to "auto"
- if sys.platform == 'win32':
- # mingw32 cannot link against distributed wx libs
- # since they are built with VisualStudio
- if win32_compiler == 'mingw32':
- return
- else:
- pass
-
- elif wxconfig is None:
- print """
-WXAgg's accelerator requires `wx-config'.
-
-The `wx-config\' executable could not be located in any directory of the
-PATH environment variable. If you want to build WXAgg, and wx-config is
-in some other location or has some other name, set the WX_CONFIG
-environment variable to the full path of the executable like so:
-
-export WX_CONFIG=/usr/lib/wxPython-2.6.1.0-gtk2-unicode/bin/wx-config
-"""
- if not abortOnFailure:
- print """Building MPL without wxAgg"""
- BUILT_WXAGG = True
- return
- else:
- sys.exit(1)
- elif not check_wxpython_headers(wxconfig):
- print 'WXAgg\'s accelerator requires the wxPython headers.'
-
- if not abortOnFailure:
- BUILT_WXAGG = True
- return
- else:
- print """
-The wxPython header files could not be located in any of the standard
-include
-directories or include directories reported by `wx-config --cppflags'."""
- sys.exit(1)
- elif not check_wxpython_broken_macosx104_version(wxconfig):
- print 'WXAgg\'s accelerator not building because a broken wxPython (installed by Apple\'s Mac OS X) was found.'
- if not abortOnFailure:
- BUILT_WXAGG = True
- return
- else:
- print """
-The wxPython installation is the broken version installed with Mac OS X 10.4."""
- sys.exit(1)
-
deps = ['src/_wxagg.cpp', 'src/mplutils.cpp']
deps.extend(glob.glob('CXX/*.cxx'))
deps.extend(glob.glob('CXX/*.c'))
@@ -627,8 +810,6 @@
BUILT_WXAGG = True
-
-
def build_agg(ext_modules, packages):
global BUILT_AGG
if BUILT_AGG: return # only build it if you you haven't already
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2007-07-31 14:05:10
|
Revision: 3645
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3645&view=rev
Author: dsdale
Date: 2007-07-31 07:05:01 -0700 (Tue, 31 Jul 2007)
Log Message:
-----------
minor updates to config package
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/config/mplconfig.py
trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf
Added Paths:
-----------
trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.backup
Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-07-31 13:11:34 UTC (rev 3644)
+++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-07-31 14:05:01 UTC (rev 3645)
@@ -11,7 +11,7 @@
import mpltraits as mplT
import cutils
import checkdep
-from tconfig import TConfig, TConfigManager
+from tconfig import TConfig, TConfigManager, tconf2File
import pytz
# Code begins
@@ -503,9 +503,9 @@
rcParams = RcParamsWrapper(mplConfig)
##############################################################################
-# Simple testing
+# Auto-generate the mpl-data/matplotlib.conf
##############################################################################
if __name__ == "__main__":
mplConfig = MPLConfig()
- mplConfig.backend.pdf.compression = 1.1
- print mplConfig
+ tconf2File(mplConfig, '../mpl-data/matplotlib.conf', force=True)
+ print 'Default matplotlib.conf created in ../mpl-data'
Modified: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf
===================================================================
--- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf 2007-07-31 13:11:34 UTC (rev 3644)
+++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf 2007-07-31 14:05:01 UTC (rev 3645)
@@ -1,456 +1,402 @@
-### MATPLOTLIBRC FORMAT
+# MPLConfig - plaintext (in .conf format)
# This is a sample matplotlib configuration file. It should be placed
# in HOME/.matplotlib/matplotlibrc (unix/linux like systems) and
# C:\Documents and Settings\yourname\.matplotlib (win32 systems)
-#
-# By default, the installer will overwrite the existing file in the
-# install path, so if you want to preserve your's, please move it to
-# your HOME dir and set the environment variable if necessary.
-#
-# This file is best viewed in a editor which supports ini or conf mode
-# syntax highlighting
-#
+#
+# By default, the installer will overwrite the existing file in the install
+# path, so if you want to preserve yours, please move it to your HOME dir and
+# set the environment variable if necessary.
+#
+# This file is best viewed in a editor which supports ini or conf mode syntax
+# highlighting.
+#
# Blank lines, or lines starting with a comment symbol, are ignored,
# as are trailing comments. Other lines must have the format
-#
-# key = val # optional comment
-#
+#
+# key = val optional comment
+#
# val should be valid python syntax, just as you would use when setting
# properties using rcParams. This should become more obvious by inspecting
# the default values listed herein.
-#
+#
# Colors: for the color values below, you can either use
# - a matplotlib color string, such as r, k, or b
# - an rgb tuple, such as (1.0, 0.5, 0.0)
# - a hex string, such as #ff00ff or ff00ff
# - a scalar grayscale intensity such as 0.75
# - a legal html color name, eg red, blue, darkslategray
+#
+# Interactivity: see http://matplotlib.sourceforge.net/interactive.html.
+#
+# ### CONFIGURATION BEGINS HERE ###
-#### CONFIGURATION BEGINS HERE
-
-# numpy, Numeric or numarray
-numerix = 'numpy'
-
-# True to use external maskedarray module instead of numpy.ma; this is a
-# temporary setting for testing maskedarray.
-maskedarray = False
-
-# see http://matplotlib.sourceforge.net/interactive.html
+# a value of type 'str'
+datapath = '/usr/lib64/python2.5/site-packages/matplotlib-0.90.1_r3640-py2.5-linux-x86_64.egg/matplotlib/mpl-data'
+# one of 0, on, false, 1, no, n, y, off, yes, true
interactive = False
-
-# None | classic | toolbar2
-toolbar = 'toolbar2'
-
-# a pytz timezone string, eg US/Central or Europe/Paris
+# a value of type 'bool'
+maskedarray = False
+# 'numpy' or 'numeric' or 'numarray'
+numerix = 'numpy'
+# 'Africa/Abidjan' or 'Africa/Accra' or 'Africa/Addis_Ababa' or 'Africa/Algiers'
+# or 'Africa/Asmara' or 'Africa/Asmera' or 'Africa/Bamako' or 'Africa/Bangui' o
+# r 'Africa/Banjul' or 'Africa/Bissau' or 'Africa/Blantyre' or 'Africa/Brazzavil
+# <...snipped 10590 chars...>
+# or 'Turkey' or 'UCT' or 'US/Alaska' or 'US/Aleutian' or 'US/Arizona' or 'US/Ce
+# ntral' or 'US/East-Indiana' or 'US/Eastern' or 'US/Hawaii' or 'US/Indiana-Star
+# ke' or 'US/Michigan' or 'US/Mountain' or 'US/Pacific' or 'US/Pacific-New' or '
+# US/Samoa' or 'UTC' or 'Universal' or 'W-SU' or 'WET' or 'Zulu' or 'posixrules'
timezone = 'UTC'
-
+# 'toolbar2' or None
+toolbar = 'toolbar2'
+# a value of type 'bool'
units = False
-# Where your matplotlib data lives if you installed to a non-default
-#location. This is where the matplotlib fonts, bitmaps, etc reside
-#datapath = '/home/fperez/.matplotlib'
+[axes]
+ # a value of type 'bool'
+ axisbelow = False
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
+ edgecolor = 'black'
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
+ facecolor = 'white'
+ # one of 0, on, false, 1, no, n, y, off, yes, true
+ grid = False
+ # one of 0, on, false, 1, no, n, y, off, yes, true
+ hold = True
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
+ labelcolor = 'black'
+ # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium'
+ # or 'large' or 'x-large' or 'xx-large'
+ labelsize = 'medium'
+ # a value of type 'float'
+ linewidth = 1.0
+ # one of 0, on, false, 1, no, n, y, off, yes, true
+ polargrid = True
+ # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium'
+ # or 'large' or 'x-large' or 'xx-large'
+ titlesize = 'large'
-#bogus = 1
-#[bogus_section]
-# foo = 1
+ [[formatter]]
+ # a list of from 2 to 2 items each of which is a value of type 'float'
+ limits = [-7.0, 7.0]
[backend]
-
- #[[bogus_subsection]]
- # bar =1
-
- # 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg', 'TkAgg', 'Agg',
- # 'Cairo', 'PS', 'PDF', 'SVG'
- use = 'TkAgg'
-
+ # Valid backends are: 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg',
+ # 'TkAgg', 'Agg', 'Cairo', 'PS', 'PDF', 'SVG'
+ # one of ps, qt4agg, tkagg, gtkagg, agg, cairo, gtkcairo, wxagg, qtagg, temp
+ # late, svg, pdf
+ use = 'PS'
+
[[cairo]]
- # png, ps, pdf, svg
+ # 'png' or 'ps' or 'pdf' or 'svg'
format = 'png'
-
- [[tk]]
- # Maintain shell focus for TkAgg
- window_focus = False
-
- # tk sets PYTHONINSEPCT
- pythoninspect = False
-
+
+ [[pdf]]
+ # 0 <= an integer <= 9
+ compression = 6
+ # 3 or 42
+ fonttype = 3
+ # a value of type 'bool'
+ inheritcolor = False
+ # a value of type 'bool'
+ use14corefonts = False
+
[[ps]]
- # auto, letter, legal, ledger, A0-A10, B0-B10
+ # 3 or 42
+ fonttype = 3
+ # 'auto' or 'letter' or 'legal' or 'ledger' or 'A0' or 'A1' or 'A2' or '
+ # A3' or 'A4' or 'A5' or 'A6' or 'A7' or 'A8' or 'A9' or 'A10' or 'B0' o
+ # r 'B1' or 'B2' or 'B3' or 'B4' or 'B5' or 'B6' or 'B7' or 'B8' or 'B9'
+ # or 'B10'
papersize = 'letter'
-
- # use of afm fonts, results in smaller files
+ # a value of type 'bool'
useafm = False
-
- # 3 (Type3) or 42 (TrueType)
- fonttype = 3
-
+
[[[distiller]]]
- # can be: None, ghostscript or xpdf
- # xpdf intended for production of publication quality
- # files, but requires ghostscript, xpdf and ps2eps
- use = None
-
- # distiller resolution, dpi
+ # a value of type 'float'
resolution = 6000.0
-
- [[pdf]]
- # integer from 0 to 9
- # 0 disables compression (good for debugging)
- compression = 6
-
- # 3 (Type3) or 42 (TrueType)
- fonttype = 3
-
+ # a bool or None or 'ghostscript' or 'xpdf'
+ use = None
+
[[svg]]
- # write raster image data directly into the svg file
+ # a value of type 'bool'
+ embed_chars = False
+ # a value of type 'bool'
image_inline = True
-
- # suppress scaling of raster data embedded in SVG
+ # a value of type 'bool'
image_noscale = False
-
- # embed character outlines in the SVG file
- embed_chars = False
+ [[tk]]
+ # window_focus : Maintain shell focus for TkAgg
+ # pythoninspect: tk sets PYTHONINSPECT
+
+ # a value of type 'bool'
+ pythoninspect = False
+ # a value of type 'bool'
+ window_focus = False
+
+[contour]
+ # 'dashed' or 'solid'
+ negative_linestyle = 'dashed'
+
+[figure]
+ # a value of type 'float'
+ dpi = 80.0
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
+ edgecolor = 'white'
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
+ facecolor = '0.75'
+ # a list of from 2 to 2 items each of which is a value of type 'float'
+ figsize = [8.0, 6.0]
+
+ [[subplot]]
+ # The figure subplot parameters. All dimensions are fraction
+ # of the figure width or height
+ # a value of type 'float'
+ bottom = 0.10000000000000001
+ # a value of type 'float'
+ hspace = 0.20000000000000001
+ # a value of type 'float'
+ left = 0.125
+ # a value of type 'float'
+ right = 0.90000000000000002
+ # a value of type 'float'
+ top = 0.90000000000000002
+ # a value of type 'float'
+ wspace = 0.20000000000000001
+
+[font]
+ # a list of items each of which is a value of type 'str'
+ cursive = ['Apple Chancery', 'Textile', 'Zapf Chancery', 'Sand', 'cursive']
+ # 'sans-serif' or 'serif' or 'cursive' or 'fantasy' or 'monospace'
+ family = 'sans-serif'
+ # a list of items each of which is a value of type 'str'
+ fantasy = ['Comic Sans MS', 'Chicago', 'Charcoal', 'Impact', 'Western', 'fantasy']
+ # a list of items each of which is a value of type 'str'
+ monospace = ['Bitstream Vera Sans Mono', 'Andale Mono', 'Nimbus Mono L', 'Courier New', 'Courier', 'Fixed', 'Terminal', 'monospace']
+ # a list of items each of which is a value of type 'str'
+ sans_serif = ['Bitstream Vera Sans', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', 'sans-serif']
+ # a list of items each of which is a value of type 'str'
+ serif = ['Bitstream Vera Serif', 'New Century Schoolbook', 'Century Schoolbook L', 'Utopia', 'ITC Bookman', 'Bookman', 'Nimbus Roman No9 L', 'Times New Roman', 'Times', 'Palatino', 'Charter', 'serif']
+ # a value of type 'float'
+ size = 12.0
+ # 'ultra-condensed' or 'extra-condensed' or 'condensed' or 'semi-condensed'
+ # or 'normal' or 'semi-expanded' or 'expanded' or 'extra-expanded' or 'ultra
+ # -expanded' or 'wider' or 'narrower'
+ stretch = 'normal'
+ # 'normal' or 'italic' or 'oblique'
+ style = 'normal'
+ # 'normal' or 'small-caps'
+ variant = 'normal'
+ # 'normal' or 'bold' or 'bolder' or 'lighter' or 100 or 200 or 300 or 400 or
+ # 500 or 600 or 700 or 800 or 900
+ weight = 'normal'
+
+[grid]
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
+ color = 'black'
+ # '-' or '--' or '-.' or ':' or 'steps' or '' or ' '
+ linestyle = ':'
+ # a value of type 'float'
+ linewidth = 0.5
+
+[image]
+ # a value of type 'float' or 'equal' or 'auto'
+ aspect = 'equal'
+ # 'Accent' or 'Accent_r' or 'Blues' or 'Blues_r' or 'BrBG' or 'BrBG_r' or 'B
+ # uGn' or 'BuGn_r' or 'BuPu' or 'BuPu_r' or 'Dark2' or 'Dark2_r' or 'GnBu' o
+ # r 'GnBu_r' or 'Greens' or 'Greens_r' or 'Greys' or 'Greys_r' or 'OrRd' or
+ # <...snipped 1010 chars...>
+ # ist_stern' or 'gist_stern_r' or 'gist_yarg' or 'gist_yarg_r' or 'gray' or
+ # 'gray_r' or 'hot' or 'hot_r' or 'hsv' or 'hsv_r' or 'jet' or 'jet_r' or 'p
+ # ink' or 'pink_r' or 'prism' or 'prism_r' or 'spectral' or 'spectral_r' or
+ # 'spring' or 'spring_r' or 'summer' or 'summer_r' or 'winter' or 'winter_r'
+ cmap = 'jet'
+ # 'bilinear' or 'nearest' or 'bicubic' or 'spline16' or 'spline36' or 'hanni
+ # ng' or 'hamming' or 'hermite' or 'kaiser' or 'quadric' or 'catrom' or 'gau
+ # ssian' or 'bessel' or 'mitchell' or 'sinc' or 'lanczos' or 'blackman'
+ interpolation = 'bilinear'
+ # a value of type 'int'
+ lut = 256
+ # 'upper' or 'lower'
+ origin = 'upper'
+
+[legend]
+ # a value of type 'float'
+ axespad = 0.02
+ # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium'
+ # or 'large' or 'x-large' or 'xx-large'
+ fontsize = 'medium'
+ # a value of type 'float'
+ handlelen = 0.050000000000000003
+ # a value of type 'float'
+ handletextsep = 0.02
+ # a value of type 'bool'
+ isaxes = True
+ # a value of type 'float'
+ labelsep = 0.01
+ # 'best' or 'upper right' or 'upper left' or 'lower left' or 'lower right' o
+ # r 'right' or 'center left' or 'center right' or 'lower center' or 'upper c
+ # enter' or 'center'
+ loc = 'upper right'
+ # a value of type 'float'
+ markerscale = 1.0
+ # a value of type 'int'
+ numpoints = 3
+ # a value of type 'float'
+ pad = 0.20000000000000001
+ # a value of type 'bool'
+ shadow = False
+
[lines]
- # See http://matplotlib.sourceforge.net/matplotlib.lines.html for more
- # information on line properties.
-
- # line width in points
- linewidth = 1.0
-
- # '-','--','-.', ':', 'steps', '', ' ', or None
- linestyle = '-'
-
+ # a value of type 'bool'
+ antialiased = True
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
color = 'blue'
-
- # The default marker: 'None', 'o', '.', ',', '^', 'v', '<', '>', 's', '+',
- # 'x', 'D', 'd', '1', '2', '3', '4', 'h', 'H', 'p', '|', '_'
+ # 'butt' or 'round' or 'projecting'
+ dash_capstyle = 'butt'
+ # 'miter' or 'round' or 'bevel'
+ dash_joinstyle = 'miter'
+ # '-' or '--' or '-.' or ':' or 'steps' or '' or ' ' or None
+ linestyle = '-'
+ # a value of type 'float'
+ linewidth = 1.0
+ # 'None' or 'o' or '.' or ',' or '^' or 'v' or '<' or '>' or 's' or '+' or '
+ # x' or 'D' or 'd' or '1' or '2' or '3' or '4' or 'h' or 'H' or 'p' or '|' o
+ # r '_'
marker = 'None'
-
- # the line width around the marker symbol
+ # a value of type 'float'
markeredgewidth = 0.5
-
- # markersize, in points
+ # a value of type 'float'
markersize = 6.0
-
- # miter|round|bevel
- dash_joinstyle = 'miter'
+ # 'butt' or 'round' or 'projecting'
+ solid_capstyle = 'butt'
+ # 'miter' or 'round' or 'bevel'
solid_joinstyle = 'miter'
-
- # butt|round|projecting
- dash_capstyle = 'butt'
- solid_capstyle = 'projecting'
-
- # render antialised lines (no jaggies)
- antialiased = True
[patch]
- # Patches are graphical objects that fill 2D space, like polygons or
- # circles. See
- # http://matplotlib.sourceforge.net/matplotlib.patches.html for more
- # information on patch properties
-
- # edge width in points
- linewidth = 1.0
-
- facecolor = 'blue'
- edgecolor = 'black'
-
- # render antialised lines (no jaggies)
+ # a value of type 'bool'
antialiased = True
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
+ edgecolor = 'black'
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
+ facecolor = 'blue'
+ # a value of type 'float'
+ linewidth = 1.0
-[font]
- # font properties used by text.Text. See
- # http://matplotlib.sourceforge.net/matplotlib.font_manager.html for more
- # information on font properties. The 6 font properties used for font
- # matching are given below with their default values.
- #
- # The font.family property has five values: 'serif' (e.g. Times),
- # 'sans-serif' (e.g. Helvetica), 'cursive' (e.g. Zapf-Chancery),
- # 'fantasy' (e.g. Western), and 'monospace' (e.g. Courier). Each of
- # these font families has a default list of font names in decreasing
- # order of priority associated with them.
- family = 'sans-serif'
-
- # The font.style property has three values: normal (or roman), italic
- # or oblique. The oblique style will be used for italic, if it is not
- # present.
- style = 'normal'
-
- # The font.variant property has two values: normal or small-caps. For
- # TrueType fonts, which are scalable fonts, small-caps is equivalent
- # to using a font size of 'smaller', or about 83% of the current font
- # size.
- variant = 'normal'
-
- # The font.weight property has effectively 13 values= normal, bold,
- # bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as
- # 400, and bold is 700. bolder and lighter are relative values with
- # respect to the current weight.
- weight = 'normal'
-
- # The font.stretch property has 11 values: ultra-condensed,
- # extra-condensed, condensed, semi-condensed, normal, semi-expanded,
- # expanded, extra-expanded, ultra-expanded, wider, and narrower. This
- # property is not currently implemented.
- stretch = 'normal'
-
- # The font.size property is the default font size for text, given in pts.
- # 12pt is the standard value.
- #
- # Note that font.size controls default text sizes. To configure
- # special text sizes tick labels, axes, labels, title, etc, see the rc
- # settings for axes and ticks. Special text sizes can be defined
- # relative to font.size, using the following values: xx-small, x-small,
- # small, medium, large, x-large, xx-large, larger, or smaller
- size = 12.0
-
- # A search list for each of the font families
- serif = ['Bitstream Vera Serif', 'New Century Schoolbook', 'Century Schoolbook L', 'Utopia', 'ITC Bookman', 'Bookman', 'Nimbus Roman No9 L', 'Times New Roman', 'Times', 'Palatino', 'Charter', 'serif']
- sans_serif = ['Bitstream Vera Sans', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', 'sans-serif']
- cursive = ['Apple Chancery', 'Textile', 'Zapf Chancery', 'Sand', 'cursive']
- fantasy = ['Comic Sans MS', 'Chicago', 'Charcoal', 'Impact', 'Western', 'fantasy']
- monospace = ['Bitstream Vera Sans Mono', 'Andale Mono', 'Nimbus Mono L', 'Courier New', 'Courier', 'Fixed', 'Terminal', 'monospace']
+[savefig]
+ # a value of type 'float'
+ dpi = 100.0
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
+ edgecolor = 'white'
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
+ facecolor = 'white'
+ # 'portrait' or 'landscape'
+ orientation = 'portrait'
[text]
- # text properties used by text.Text. See
- # http://matplotlib.sourceforge.net/matplotlib.text.html for more
- # information on text properties
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
color = 'black'
-
- ### LaTeX customizations
- # See http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex
-
- # use latex for all text handling. The following fonts
- # are supported through the usual rc parameter settings:
- # new century schoolbook, bookman, times, palatino,
- # zapf chancery, charter, serif, sans-serif, helvetica,
- # avant garde, courier, monospace, computer modern roman,
- # computer modern sans serif, computer modern typewriter
- # If another font is desired which can loaded using the
- # LaTeX \usepackage command, please inquire at the
- # matplotlib mailing list
+ # a value of type 'bool'
usetex = False
-
+
[[latex]]
- # use "ucs" and "inputenc" LaTeX packages for
- # handling unicode strings.
- unicode = False
-
- # IMPROPER USE OF THE PREAMBLE WILL LEAD TO LATEX
- # FAILURES AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT
- # ASK FOR HELP IF THIS FEATURE DOES NOT DO WHAT YOU
- # EXPECT IT TO.
- # preamble is a comma separated list of LaTeX
- # statements that are included in the LaTeX document
- # preamble.
- # An example:
- # text.latex.preamble = ["\usepackage{bm}", "\usepackage{euler}"]
- # The following packages are always loaded with usetex,
- # so beware of package collisions: color, geometry,
- # graphicx, type1cm, textcomp. Adobe Postscript
- # (PSSNFS) font packages may also be loaded, depending
- # on your font settings
- preamble = []
-
- # some versions of dvipng don't handle alpha channel properly.
- # Use True to correct and flush ~/.matplotlib/tex.cache before
- # testing
+ # a value of type 'bool'
dvipnghack = False
+ # a list of items each of which is a value of type 'str'
+ preamble = []
+ # a value of type 'bool'
+ unicode = False
-[axes]
- # default face and edge color, default tick sizes,
- # default fontsizes for ticklabels, and so on. See
- # http://matplotlib.sourceforge.net/matplotlib.axes.html#Axes
-
- # whether to clear the axes by default
- hold = True
-
- # axes background color
- facecolor = 'white'
-
- # axes edge color
- edgecolor = 'black'
-
- # edge linewidth
- linewidth = 1.0
-
- # display grid on regular or polar axes
- grid = False
- polargrid = True
-
- # fontsize of the axes title and labels
- titlesize = 'large'
- labelsize = 'medium'
-
- labelcolor = 'black'
-
- # whether axis gridlines and ticks are below the axes elements
- # (lines, text, etc)
- axisbelow = False
-
- [[formatter]]
- # use scientific notation if log10 of the axis range is smaller
- # than the first or larger than the second
- limits = [-7.0, 7.0]
+ [[math]]
+ # a value of type 'str'
+ cal = 'cmsy10.ttf'
+ # a value of type 'str'
+ it = 'cmmi10.ttf'
+ # a value of type 'bool'
+ mathtext2 = False
+ # a value of type 'str'
+ mit = 'cmmi10.ttf'
+ # a value of type 'str'
+ nonascii = 'cmex10.ttf'
+ # a value of type 'str'
+ rm = 'cmr10.ttf'
+ # a value of type 'str'
+ tt = 'cmtt10.ttf'
+[verbose]
+ # a value of type 'str' or a value of type 'unicode' or 'sys.stdout'
+ fileo = 'sys.stdout'
+ # 'silent' or 'helpful' or 'debug' or 'debug-annoying'
+ level = 'silent'
+
[xticks]
- # see http://matplotlib.sourceforge.net/matplotlib.axis.html#Ticks
- color = 'k'
- labelsize = 'small'
-
- # direction: in or out
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
+ color = 'black'
+ # 'in' or 'out'
direction = 'in'
-
+ # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium'
+ # or 'large' or 'x-large' or 'xx-large'
+ labelsize = 'small'
+
[[major]]
- # in points
- size = 4.0
+ # a value of type 'float'
pad = 4.0
-
+ # a value of type 'float'
+ size = 4.0
+
[[minor]]
- # in points
- size = 2.0
+ # a value of type 'float'
pad = 4.0
+ # a value of type 'float'
+ size = 2.0
[yticks]
- color = 'k'
- labelsize = 'small'
-
- # direction: in or out
+ # any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+ # name like 'orange', a hex color like '#efefef', a grayscale intensity
+ # like '0.5', or an RGBA tuple (1,0,0,1)
+ color = 'black'
+ # 'in' or 'out'
direction = 'in'
-
+ # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium'
+ # or 'large' or 'x-large' or 'xx-large'
+ labelsize = 'small'
+
[[major]]
- # in points
- size = 4.0
+ # a value of type 'float'
pad = 4.0
-
+ # a value of type 'float'
+ size = 4.0
+
[[minor]]
- # in points
- size = 2.0
+ # a value of type 'float'
pad = 4.0
-
-[grid]
- color = 'black'
-
- # '-','--','-.', ':', 'steps', '', ' ', or None
- linestyle = ':'
-
- linewidth = 0.5
-
-[legend]
- loc = 'upper right'
-
- isaxes = True
-
- # the number of points in the legend line
- numpoints = 2
-
- fontsize = 'medium'
-
- # the fractional whitespace inside the legend border
- pad = 0.20000000000000001
-
- # the relative size of legend markers vs. original
- # the following dimensions are in axes coords
- markerscale = 1.0
-
- # the vertical space between the legend entries
- labelsep = 0.01
-
- # the length of the legend lines
- handlelen = 0.050000000000000003
-
- # the space between the legend line and legend text
- handletextsep = 0.02
-
- # the border between the axes and legend edge
- axespad = 0.02
-
- # Show a shadow behind the legend
- shadow = False
-
-[figure]
- # See http://matplotlib.sourceforge.net/matplotlib.figure.html#Figure
-
- # figure size in inches
- figsize = [8.0, 6.0]
-
- # figure dots per inch
- dpi = 80.0
-
- # figure face and edge colors; '0.75' is scalar gray
- facecolor = '0.75'
- edgecolor = 'white'
-
- [[subplot]]
- # The figure subplot parameters. All dimensions are fraction of the
- # figure width or height
- left = 0.125
- right = 0.90000000000000002
- bottom = 0.10000000000000001
- top = 0.90000000000000002
-
- # the amount of width or height reserved for blank space between
- #subplots
- wspace = 0.20000000000000001
- hspace = 0.20000000000000001
-
-
-[image]
- # equal | auto | a number
- aspect = 'equal'
-
- # see help(imshow) for options
- interpolation = 'bilinear'
- cmap = 'jet'
-
- # the size of the colormap lookup table
- lut = 256
-
- # 'lower' or 'upper'
- origin = 'upper'
-
-
-[contour]
- # 'dashed' or 'solid'
- negative_linestyle = 'dashed'
-
-[savefig]
- # Saving figures
- # the default savefig params can be different for the GUI backends.
- # Eg, you may want a higher resolution, or to make the figure
- # background white
-
- # figure dots per inch
- dpi = 100.0
-
- # figure face and edge colors
- facecolor = 'white'
- edgecolor = 'white'
- orientation = 'portrait'
-
-[verbose]
- # Set the verbose flags. This controls how much information
- # matplotlib gives you at runtime and where it goes. The verbosity
- # levels are: silent, helpful, debug, debug-annoying. Any level is
- # inclusive of all the levels below it. If you setting is debug,
- # you'll get all the debug and helpful messages. When submitting
- # problems to the mailing-list, please set verbose to helpful or debug
- # and paste the output into your report.
- #
- # The fileo gives the destination for any calls to verbose.report.
- # These objects can a filename, or a filehandle like sys.stdout.
- #
- # You can override the rc default verbosity from the command line by
- # giving the flags --verbose-LEVEL where LEVEL is one of the legal
- # levels, eg --verbose-helpful.
- #
- # You can access the verbose instance in your code
- # from matplotlib import verbose.
-
- # 'silent', 'helpful', 'debug', or 'debug-annoying'
- level = 'silent'
-
- # a log filename, 'sys.stdout' or 'sys.stderr'
- fileo = 'sys.stdout'
+ # a value of type 'float'
+ size = 2.0
\ No newline at end of file
Added: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.backup
===================================================================
--- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.backup (rev 0)
+++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf.backup 2007-07-31 14:05:01 UTC (rev 3645)
@@ -0,0 +1,456 @@
+### MATPLOTLIBRC FORMAT
+
+# This is a sample matplotlib configuration file. It should be placed
+# in HOME/.matplotlib/matplotlibrc (unix/linux like systems) and
+# C:\Documents and Settings\yourname\.matplotlib (win32 systems)
+#
+# By default, the installer will overwrite the existing file in the
+# install path, so if you want to preserve your's, please move it to
+# your HOME dir and set the environment variable if necessary.
+#
+# This file is best viewed in a editor which supports ini or conf mode
+# syntax highlighting
+#
+# Blank lines, or lines starting with a comment symbol, are ignored,
+# as are trailing comments. Other lines must have the format
+#
+# key = val # optional comment
+#
+# val should be valid python syntax, just as you would use when setting
+# properties using rcParams. This should become more obvious by inspecting
+# the default values listed herein.
+#
+# Colors: for the color values below, you can either use
+# - a matplotlib color string, such as r, k, or b
+# - an rgb tuple, such as (1.0, 0.5, 0.0)
+# - a hex string, such as #ff00ff or ff00ff
+# - a scalar grayscale intensity such as 0.75
+# - a legal html color name, eg red, blue, darkslategray
+
+#### CONFIGURATION BEGINS HERE
+
+# numpy, Numeric or numarray
+numerix = 'numpy'
+
+# True to use external maskedarray module instead of numpy.ma; this is a
+# temporary setting for testing maskedarray.
+maskedarray = False
+
+# see http://matplotlib.sourceforge.net/interactive.html
+interactive = False
+
+# None | classic | toolbar2
+toolbar = 'toolbar2'
+
+# a pytz timezone string, eg US/Central or Europe/Paris
+timezone = 'UTC'
+
+units = False
+
+# Where your matplotlib data lives if you installed to a non-default
+#location. This is where the matplotlib fonts, bitmaps, etc reside
+#datapath = '/home/fperez/.matplotlib'
+
+#bogus = 1
+#[bogus_section]
+# foo = 1
+
+[backend]
+
+ #[[bogus_subsection]]
+ # bar =1
+
+ # 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg', 'TkAgg', 'Agg',
+ # 'Cairo', 'PS', 'PDF', 'SVG'
+ use = 'TkAgg'
+
+ [[cairo]]
+ # png, ps, pdf, svg
+ format = 'png'
+
+ [[tk]]
+ # Maintain shell focus for TkAgg
+ window_focus = False
+
+ # tk sets PYTHONINSEPCT
+ pythoninspect = False
+
+ [[ps]]
+ # auto, letter, legal, ledger, A0-A10, B0-B10
+ papersize = 'letter'
+
+ # use of afm fonts, results in smaller files
+ useafm = False
+
+ # 3 (Type3) or 42 (TrueType)
+ fonttype = 3
+
+ [[[distiller]]]
+ # can be: None, ghostscript or xpdf
+ # xpdf intended for production of publication quality
+ # files, but requires ghostscript, xpdf and ps2eps
+ use = None
+
+ # distiller resolution, dpi
+ resolution = 6000.0
+
+ [[pdf]]
+ # integer from 0 to 9
+ # 0 disables compression (good for debugging)
+ compression = 6
+
+ # 3 (Type3) or 42 (TrueType)
+ fonttype = 3
+
+ [[svg]]
+ # write raster image data directly into the svg file
+ image_inline = True
+
+ # suppress scaling of raster data embedded in SVG
+ image_noscale = False
+
+ # embed character outlines in the SVG file
+ embed_chars = False
+
+[lines]
+ # See http://matplotlib.sourceforge.net/matplotlib.lines.html for more
+ # information on line properties.
+
+ # line width in points
+ linewidth = 1.0
+
+ # '-','--','-.', ':', 'steps', '', ' ', or None
+ linestyle = '-'
+
+ color = 'blue'
+
+ # The default marker: 'None', 'o', '.', ',', '^', 'v', '<', '>', 's', '+',
+ # 'x', 'D', 'd', '1', '2', '3', '4', 'h', 'H', 'p', '|', '_'
+ marker = 'None'
+
+ # the line width around the marker symbol
+ markeredgewidth = 0.5
+
+ # markersize, in points
+ markersize = 6.0
+
+ # miter|round|bevel
+ dash_joinstyle = 'miter'
+ solid_joinstyle = 'miter'
+
+ # butt|round|projecting
+ dash_capstyle = 'butt'
+ solid_capstyle = 'projecting'
+
+ # render antialised lines (no jaggies)
+ antialiased = True
+
+[patch]
+ # Patches are graphical objects that fill 2D space, like polygons or
+ # circles. See
+ # http://matplotlib.sourceforge.net/matplotlib.patches.html for more
+ # information on patch properties
+
+ # edge width in points
+ linewidth = 1.0
+
+ facecolor = 'blue'
+ edgecolor = 'black'
+
+ # render antialised lines (no jaggies)
+ antialiased = True
+
+[font]
+ # font properties used by text.Text. See
+ # http://matplotlib.sourceforge.net/matplotlib.font_manager.html for more
+ # information on font properties. The 6 font properties used for font
+ # matching are given below with their default values.
+ #
+ # The font.family property has five values: 'serif' (e.g. Times),
+ # 'sans-serif' (e.g. Helvetica), 'cursive' (e.g. Zapf-Chancery),
+ # 'fantasy' (e.g. Western), and 'monospace' (e.g. Courier). Each of
+ # these font families has a default list of font names in decreasing
+ # order of priority associated with them.
+ family = 'sans-serif'
+
+ # The font.style property has three values: normal (or roman), italic
+ # or oblique. The oblique style will be used for italic, if it is not
+ # present.
+ style = 'normal'
+
+ # The font.variant property has two values: normal or small-caps. For
+ # TrueType fonts, which are scalable fonts, small-caps is equivalent
+ # to using a font size of 'smaller', or about 83% of the current font
+ # size.
+ variant = 'normal'
+
+ # The font.weight property has effectively 13 values= normal, bold,
+ # bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as
+ # 400, and bold is 700. bolder and lighter are relative values with
+ # respect to the current weight.
+ weight = 'normal'
+
+ # The font.stretch property has 11 values: ultra-condensed,
+ # extra-condensed, condensed, semi-condensed, normal, semi-expanded,
+ # expanded, extra-expanded, ultra-expanded, wider, and narrower. This
+ # property is not currently implemented.
+ stretch = 'normal'
+
+ # The font.size property is the default font size for text, given in pts.
+ # 12pt is the standard value.
+ #
+ # Note that font.size controls default text sizes. To configure
+ # special text sizes tick labels, axes, labels, title, etc, see the rc
+ # settings for axes and ticks. Special text sizes can be defined
+ # relative to font.size, using the following values: xx-small, x-small,
+ # small, medium, large, x-large, xx-large, larger, or smaller
+ size = 12.0
+
+ # A search list for each of the font families
+ serif = ['Bitstream Vera Serif', 'New Century Schoolbook', 'Century Schoolbook L', 'Utopia', 'ITC Bookman', 'Bookman', 'Nimbus Roman No9 L', 'Times New Roman', 'Times', 'Palatino', 'Charter', 'serif']
+ sans_serif = ['Bitstream Vera Sans', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', 'sans-serif']
+ cursive = ['Apple Chancery', 'Textile', 'Zapf Chancery', 'Sand', 'cursive']
+ fantasy = ['Comic Sans MS', 'Chicago', 'Charcoal', 'Impact', 'Western', 'fantasy']
+ monospace = ['Bitstream Vera Sans Mono', 'Andale Mono', 'Nimbus Mono L', 'Courier New', 'Courier', 'Fixed', 'Terminal', 'monospace']
+
+[text]
+ # text properties used by text.Text. See
+ # http://matplotlib.sourceforge.net/matplotlib.text.html for more
+ # information on text properties
+ color = 'black'
+
+ ### LaTeX customizations
+ # See http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex
+
+ # use latex for all text handling. The following fonts
+ # are supported through the usual rc parameter settings:
+ # new century schoolbook, bookman, times, palatino,
+ # zapf chancery, charter, serif, sans-serif, helvetica,
+ # avant garde, courier, monospace, computer modern roman,
+ # computer modern sans serif, computer modern typewriter
+ # If another font is desired which can loaded using the
+ # LaTeX \usepackage command, please inquire at the
+ # matplotlib mailing list
+ usetex = False
+
+ [[latex]]
+ # use "ucs" and "inputenc" LaTeX packages for
+ # handling unicode strings.
+ unicode = False
+
+ # IMPROPER USE OF THE PREAMBLE WILL LEAD TO LATEX
+ # FAILURES AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT
+ # ASK FOR HELP IF THIS FEATURE DOES NOT DO WHAT YOU
+ # EXPECT IT TO.
+ # preamble is a comma separated list of LaTeX
+ # statements that are included in the LaTeX document
+ # preamble.
+ # An example:
+ # text.latex.preamble = ["\usepackage{bm}", "\usepackage{euler}"]
+ # The following packages are always loaded with usetex,
+ # so beware of package collisions: color, geometry,
+ # graphicx, type1cm, textcomp. Adobe Postscript
+ # (PSSNFS) font packages may also be loaded, depending
+ # on your font settings
+ preamble = []
+
+ # some versions of dvipng don't handle alpha channel properly.
+ # Use True to correct and flush ~/.matplotlib/tex.cache before
+ # testing
+ dvipnghack = False
+
+[axes]
+ # default face and edge color, default tick sizes,
+ # default fontsizes for ticklabels, and so on. See
+ # http://matplotlib.sourceforge.net/matplotlib.axes.html#Axes
+
+ # whether to clear the axes by default
+ hold = True
+
+ # axes background color
+ facecolor = 'white'
+
+ # axes edge color
+ edgecolor = 'black'
+
+ # edge linewidth
+ linewidth = 1.0
+
+ # display grid on regular or polar axes
+ grid = False
+ polargrid = True
+
+ # fontsize of the axes title and labels
+ titlesize = 'large'
+ labelsize = 'medium'
+
+ labelcolor = 'black'
+
+ # whether axis gridlines and ticks are below the axes elements
+ # (lines, text, etc)
+ axisbelow = False
+
+ [[formatter]]
+ # use scientific notation if log10 of the axis range is smaller
+ # than the first or larger than the second
+ limits = [-7.0, 7.0]
+
+[xticks]
+ # see http://matplotlib.sourceforge.net/matplotlib.axis.html#Ticks
+ color = 'k'
+ labelsize = 'small'
+
+ # direction: in or out
+ direction = 'in'
+
+ [[major]]
+ # in points
+ size = 4.0
+ pad = 4.0
+
+ [[minor]]
+ # in points
+ size = 2.0
+ pad = 4.0
+
+[yticks]
+ color = 'k'
+ labelsize = 'small'
+
+ # direction: in or out
+ direction = 'in'
+
+ [[major]]
+ # in points
+ size = 4.0
+ pad = 4.0
+
+ [[minor]]
+ # in points
+ size = 2.0
+ pad = 4.0
+
+[grid]
+ color = 'black'
+
+ # '-','--','-.', ':', 'steps', '', ' ', or None
+ linestyle = ':'
+
+ linewidth = 0.5
+
+[legend]
+ loc = 'upper right'
+
+ isaxes = True
+
+ # the number of points in the legend line
+ numpoints = 2
+
+ fontsize = 'medium'
+
+ # the fractional whitespace inside the legend border
+ pad = 0.20000000000000001
+
+ # the relative size of legend markers vs. original
+ # the following dimensions are in axes coords
+ markerscale = 1.0
+
+ # the vertical space between the legend entries
+ labelsep = 0.01
+
+ # the length of the legend lines
+ handlelen = 0.050000000000000003
+
+ # the space between the legend line and legend text
+ handletextsep = 0.02
+
+ # the border between the axes and legend edge
+ axespad = 0.02
+
+ # Show a shadow behind the legend
+ shadow = False
+
+[figure]
+ # See http://matplotlib.sourceforge.net/matplotlib.figure.html#Figure
+
+ # figure size in inches
+ figsize = [8.0, 6.0]
+
+ # figure dots per inch
+ dpi = 80.0
+
+ # figure face and edge colors; '0.75' is scalar gray
+ facecolor = '0.75'
+ edgecolor = 'white'
+
+ [[subplot]]
+ # The figure subplot parameters. All dimensions are fraction of the
+ # figure width or height
+ left = 0.125
+ right = 0.90000000000000002
+ bottom = 0.10000000000000001
+ top = 0.90000000000000002
+
+ # the amount of width or height reserved for blank space between
+ #subplots
+ wspace = 0.20000000000000001
+ hspace = 0.20000000000000001
+
+
+[image]
+ # equal | auto | a number
+ aspect = 'equal'
+
+ # see help(imshow) for options
+ interpolation = 'bilinear'
+ cmap = 'jet'
+
+ # the size of the colormap lookup table
+ lut = 256
+
+ # 'lower' or 'upper'
+ origin = 'upper'
+
+
+[contour]
+ # 'dashed' or 'solid'
+ negative_linestyle = 'dashed'
+
+[savefig]
+ # Saving figures
+ # the default savefig params can be different for the GUI backends.
+ # Eg, you may want a higher resolution, or to make the figure
+ # background white
+
+ # figure dots per inch
+ dpi = 100.0
+
+ # figure face and edge colors
+ facecolor = 'white'
+ edgecolor = 'white'
+ orientation = 'portrait'
+
+[verbose]
+ # Set the verbose flags. This controls how much information
+ # matplotlib gives you at runtime and where it goes. The verbosity
+ # levels are: silent, helpful, debug, debug-annoying. Any level is
+ # inclusive of all the levels below it. If you setting is debug,
+ # you'll get all the debug and helpful messages. When submitting
+ # problems to the mailing-list, please set verbose to helpful or debug
+ # and paste the output into your report.
+ #
+ # The fileo gives the destination for any calls to verbose.report.
+ # These objects can a filename, or a filehandle like sys.stdout.
+ #
+ # You can override the rc default verbosity from the command line by
+ # giving the flags --verbose-LEVEL where LEVEL is one of the legal
+ # levels, eg --verbose-helpful.
+ #
+ # You can access the verbose instance in your code
+ # from matplotlib import verbose.
+
+ # 'silent', 'helpful', 'debug', or 'debug-annoying'
+ level = 'silent'
+
+ # a log filename, 'sys.stdout' or 'sys.stderr'
+ fileo = 'sys.stdout'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2007-07-31 13:11:35
|
Revision: 3644
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3644&view=rev
Author: dsdale
Date: 2007-07-31 06:11:34 -0700 (Tue, 31 Jul 2007)
Log Message:
-----------
mplconfig was not reading .conf file in mpl-data
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/config/cutils.py
trunk/matplotlib/lib/matplotlib/config/mplconfig.py
trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf
Modified: trunk/matplotlib/lib/matplotlib/config/cutils.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/config/cutils.py 2007-07-31 06:53:07 UTC (rev 3643)
+++ trunk/matplotlib/lib/matplotlib/config/cutils.py 2007-07-31 13:11:34 UTC (rev 3644)
@@ -172,7 +172,7 @@
return fname
fname = os.path.join(get_configdir(), filename)
- if os.path.exists(fname) or tconfig: return fname
+ if os.path.exists(fname): return fname
path = get_data_path() # guaranteed to exist or raise
Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-07-31 06:53:07 UTC (rev 3643)
+++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-07-31 13:11:34 UTC (rev 3644)
@@ -15,6 +15,7 @@
import pytz
# Code begins
+DEBUG = False
##############################################################################
# Main Config class follows
@@ -172,7 +173,7 @@
facecolor = T.Trait('white', mplT.ColorHandler())
edgecolor = T.Trait('black', mplT.ColorHandler())
linewidth = T.Float(1.0)
- grid = T.Trait(True, mplT.BoolHandler())
+ grid = T.Trait(False, mplT.BoolHandler())
polargrid = T.Trait(True, mplT.BoolHandler())
titlesize = T.Trait('large', 'xx-small', 'x-small', 'small', 'medium',
'large', 'x-large', 'xx-large', T.Float)
@@ -467,6 +468,8 @@
config_file = cutils.get_config_file(tconfig=True)
CONVERT = False
+if DEBUG: print 'loading', config_file
+
configManager = TConfigManager(MPLConfig,
config_file,
filePriority=True)
Modified: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf
===================================================================
--- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf 2007-07-31 06:53:07 UTC (rev 3643)
+++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf 2007-07-31 13:11:34 UTC (rev 3644)
@@ -124,9 +124,9 @@
color = 'blue'
- # The default marker: None, 'o', '.', ',', '^', 'v', '<', '>', 's', '+',
+ # The default marker: 'None', 'o', '.', ',', '^', 'v', '<', '>', 's', '+',
# 'x', 'D', 'd', '1', '2', '3', '4', 'h', 'H', 'p', '|', '_'
- marker = None
+ marker = 'None'
# the line width around the marker symbol
markeredgewidth = 0.5
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fer...@us...> - 2007-07-31 06:53:09
|
Revision: 3643
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3643&view=rev
Author: fer_perez
Date: 2007-07-30 23:53:07 -0700 (Mon, 30 Jul 2007)
Log Message:
-----------
Put in changes that for some reason SVN was not seeing in my local copy. Problem reported by Stefan
Modified Paths:
--------------
trunk/py4science/examples/spline_demo.py
Modified: trunk/py4science/examples/spline_demo.py
===================================================================
--- trunk/py4science/examples/spline_demo.py 2007-07-30 23:22:48 UTC (rev 3642)
+++ trunk/py4science/examples/spline_demo.py 2007-07-31 06:53:07 UTC (rev 3643)
@@ -10,13 +10,19 @@
tfine = N.arange(0.0, 5, 0.01)
tcoarse = N.arange(0.0, 5, 0.1)
-s = N.cos(N.pi*tcoarse) * N.sin(2*N.pi*tcoarse)
+def func(t):
+ return N.cos(N.pi*t) * N.sin(2*N.pi*t)
# create sinterp by computing the spline fitting tcoarse to s and then
-evaluating it on tfine. Plot tcoarse vs s with markers and tfine vs
-sinterp with a solid line
+# evaluating it on tfine. Plot tcoarse vs s with markers and tfine vs
+# sinterp with a solid line
+s = func(tcoarse)
+
tck = interpolate.splrep(tcoarse, s, s=0)
sinterp = interpolate.splev(tfine, tck, der=0)
-P.plot(tcoarse, s, 'o', tfine, sinterp)
+P.plot(tcoarse, s, 'o', label='coarse')
+P.plot(tfine, sinterp, '+', label='fit')
+P.plot(tfine, func(tfine), '-', label='actual')
+P.legend()
P.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2007-07-30 23:22:49
|
Revision: 3642
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3642&view=rev
Author: dsdale
Date: 2007-07-30 16:22:48 -0700 (Mon, 30 Jul 2007)
Log Message:
-----------
minor change to mplconfig module
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/config/mplconfig.py
trunk/matplotlib/lib/matplotlib/mpl-data/matplotlibrc
Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-07-30 23:05:06 UTC (rev 3641)
+++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-07-30 23:22:48 UTC (rev 3642)
@@ -214,7 +214,7 @@
class grid(TConfig):
color = T.Trait('black', mplT.ColorHandler())
- linestyle = T.Trait('-','--','-.', ':', 'steps', '', ' ')
+ linestyle = T.Trait(':','-','--','-.', ':', 'steps', '', ' ')
linewidth = T.Float(0.5)
class legend(TConfig):
Modified: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlibrc
===================================================================
--- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlibrc 2007-07-30 23:05:06 UTC (rev 3641)
+++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlibrc 2007-07-30 23:22:48 UTC (rev 3642)
@@ -243,7 +243,6 @@
#savefig.dpi : 100 # figure dots per inch
#savefig.facecolor : white # figure facecolor when saving
#savefig.edgecolor : white # figure edgecolor when saving
-#savefig.orientation : portrait # portrait or landscape
#cairo.format : png # png, ps, pdf, svg
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2007-07-30 23:05:10
|
Revision: 3641
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3641&view=rev
Author: efiring
Date: 2007-07-30 16:05:06 -0700 (Mon, 30 Jul 2007)
Log Message:
-----------
bar plotting patch by Michael Forbes
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2007-07-30 21:41:09 UTC (rev 3640)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2007-07-30 23:05:06 UTC (rev 3641)
@@ -3557,7 +3557,21 @@
barcols = []
caplines = []
+ lines_kw = {'label':'_nolegend_'}
+ if 'linewidth' in kwargs:
+ lines_kw['linewidth']=kwargs['linewidth']
+ if 'lw' in kwargs:
+ lines_kw['lw']=kwargs['lw']
+ if capsize > 0:
+ plot_kw = {
+ 'ms':2*capsize,
+ 'label':'_nolegend_'}
+ if 'markeredgewidth' in kwargs:
+ plot_kw['markeredgewidth']=kwargs['markeredgewidth']
+ if 'mew' in kwargs:
+ plot_kw['mew']=kwargs['mew']
+
if xerr is not None:
if len(xerr.shape) == 1:
left = x-xerr
@@ -3566,12 +3580,10 @@
left = x-xerr[0]
right = x+xerr[1]
- barcols.append( self.hlines(y, left, right, label='_nolegend_' ))
+ barcols.append( self.hlines(y, left, right, **lines_kw ) )
if capsize > 0:
- caplines.extend(
- self.plot(left, y, 'k|', ms=2*capsize, label='_nolegend_') )
- caplines.extend(
- self.plot(right, y, 'k|', ms=2*capsize, label='_nolegend_') )
+ caplines.extend( self.plot(left, y, 'k|', **plot_kw) )
+ caplines.extend( self.plot(right, y, 'k|', **plot_kw) )
if yerr is not None:
if len(yerr.shape) == 1:
@@ -3581,21 +3593,8 @@
lower = y-yerr[0]
upper = y+yerr[1]
- vlines_kw = {'label':'_nolegend_'}
- if 'linewidth' in kwargs:
- vlines_kw['linewidth']=kwargs['linewidth']
- if 'lw' in kwargs:
- vlines_kw['lw']=kwargs['lw']
- barcols.append( self.vlines(x, lower, upper, **vlines_kw) )
-
+ barcols.append( self.vlines(x, lower, upper, **lines_kw) )
if capsize > 0:
- plot_kw = {
- 'ms':2*capsize,
- 'label':'_nolegend_'}
- if 'markeredgewidth' in kwargs:
- plot_kw['markeredgewidth']=kwargs['markeredgewidth']
- if 'mew' in kwargs:
- plot_kw['mew']=kwargs['mew']
caplines.extend( self.plot(x, lower, 'k_', **plot_kw) )
caplines.extend( self.plot(x, upper, 'k_', **plot_kw) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2007-07-30 21:41:11
|
Revision: 3640
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3640&view=rev
Author: dsdale
Date: 2007-07-30 14:41:09 -0700 (Mon, 30 Jul 2007)
Log Message:
-----------
remove a print statement in mplconfig
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/config/mplconfig.py
Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-07-30 21:37:11 UTC (rev 3639)
+++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-07-30 21:41:09 UTC (rev 3640)
@@ -462,7 +462,6 @@
config_file = os.path.join(old_config_path, 'matplotlib.conf')
if os.path.exists(old_config_file) and not os.path.exists(config_file):
- print 'convert!'
CONVERT = True
else:
config_file = cutils.get_config_file(tconfig=True)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2007-07-30 21:37:13
|
Revision: 3639
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3639&view=rev
Author: dsdale
Date: 2007-07-30 14:37:11 -0700 (Mon, 30 Jul 2007)
Log Message:
-----------
install matplotlib.conf in mpl-data for config package
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf
trunk/matplotlib/setup.py
Modified: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf
===================================================================
--- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf 2007-07-30 20:48:06 UTC (rev 3638)
+++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf 2007-07-30 21:37:11 UTC (rev 3639)
@@ -49,7 +49,7 @@
# Where your matplotlib data lives if you installed to a non-default
#location. This is where the matplotlib fonts, bitmaps, etc reside
-datapath = '/home/fperez/.matplotlib'
+#datapath = '/home/fperez/.matplotlib'
#bogus = 1
#[bogus_section]
@@ -62,7 +62,7 @@
# 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg', 'TkAgg', 'Agg',
# 'Cairo', 'PS', 'PDF', 'SVG'
- use = 'Qt4Agg'
+ use = 'TkAgg'
[[cairo]]
# png, ps, pdf, svg
@@ -453,4 +453,4 @@
level = 'silent'
# a log filename, 'sys.stdout' or 'sys.stderr'
- fileo = 'sys.stdout'
\ No newline at end of file
+ fileo = 'sys.stdout'
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py 2007-07-30 20:48:06 UTC (rev 3638)
+++ trunk/matplotlib/setup.py 2007-07-30 21:37:11 UTC (rev 3639)
@@ -93,6 +93,7 @@
'mpl-data/images/*.png',
'mpl-data/images/*.ppm',
'mpl-data/matplotlibrc',
+ 'mpl-data/matplotlib.conf',
'mpl-data/*.glade',
'backends/Matplotlib.nib/*',
]}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-07-30 20:48:09
|
Revision: 3638
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3638&view=rev
Author: mdboom
Date: 2007-07-30 13:48:06 -0700 (Mon, 30 Jul 2007)
Log Message:
-----------
Improve vertical alignment of large delimiters and n-ary operators.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/_mathtext_data.py
trunk/matplotlib/lib/matplotlib/mathtext.py
Modified: trunk/matplotlib/lib/matplotlib/_mathtext_data.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/_mathtext_data.py 2007-07-30 20:45:09 UTC (rev 3637)
+++ trunk/matplotlib/lib/matplotlib/_mathtext_data.py 2007-07-30 20:48:06 UTC (rev 3638)
@@ -2235,7 +2235,7 @@
'biguplus': 10756,
'epsilon': 949,
'vartheta': 977,
-'bigotimes': 10754
+'bigotimes': 10754
}
uni2tex = dict([(v,k) for k,v in tex2uni.items()])
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-07-30 20:45:09 UTC (rev 3637)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-07-30 20:48:06 UTC (rev 3638)
@@ -174,6 +174,13 @@
or a Type1 symbol name (i.e. 'phi').
"""
+ # From UTF #25: U+2212 − minus sign is the preferred
+ # representation of the unary and binary minus sign rather than
+ # the ASCII-derived U+002D - hyphen-minus, because minus sign is
+ # unambiguous and because it is rendered with a more desirable
+ # length, usually longer than a hyphen.
+ if symbol == '-':
+ return 0x2212
try:# This will succeed if symbol is a single unicode char
return ord(symbol)
except TypeError:
@@ -484,7 +491,7 @@
offset = self._get_offset(cached_font, glyph, fontsize, dpi)
metrics = Bunch(
advance = glyph.linearHoriAdvance/65536.0,
- height = glyph.height/64.0 + offset,
+ height = glyph.height/64.0,
width = glyph.width/64.0,
xmin = xmin,
xmax = xmax,
@@ -545,7 +552,7 @@
}
def _get_offset(self, cached_font, glyph, fontsize, dpi):
- if cached_font.font.postscript_name == 'cmex10':
+ if cached_font.font.postscript_name == 'Cmex10':
return glyph.height/64.0/2 + 256.0/64.0 * dpi/72.0
return 0.
@@ -577,8 +584,8 @@
('ex', '\xbd'), ('ex', '\x28')],
'}' : [('cal', '}'), ('ex', '\xaa'), ('ex', '\x6f'),
('ex', '\xbe'), ('ex', '\x29')],
- # The fourth size of '[' is mysteriously missing from the BaKoMa font,
- # so I've ommitted it for both
+ # The fourth size of '[' is mysteriously missing from the BaKoMa
+ # font, so I've ommitted it for both '[' and ']'
'[' : [('rm', '['), ('ex', '\xa3'), ('ex', '\x68'),
('ex', '\x22')],
']' : [('rm', ']'), ('ex', '\xa4'), ('ex', '\x69'),
@@ -839,7 +846,7 @@
INV_SHRINK_FACTOR = 1.0 / SHRINK_FACTOR
# The number of different sizes of chars to use, beyond which they will not
# get any smaller
-NUM_SIZE_LEVELS = 3
+NUM_SIZE_LEVELS = 4
# Percentage of x-height of additional horiz. space after sub/superscripts
SCRIPT_SPACE = 0.3
# Percentage of x-height that sub/superscripts drop below the baseline
@@ -1650,7 +1657,7 @@
_punctuation_symbols = Set(r', ; . ! \ldotp \cdotp'.split())
_overunder_symbols = Set(r'''
- \sum \int \prod \coprod \oint \bigcap \bigcup \bigsqcup \bigvee
+ \sum \prod \int \coprod \oint \bigcap \bigcup \bigsqcup \bigvee
\bigwedge \bigodot \bigotimes \bigoplus \biguplus
'''.split()
)
@@ -1758,9 +1765,11 @@
)
+ Optional(
Suppress(Literal("["))
- + OneOrMore(
- symbol
- ^ font
+ + Group(
+ OneOrMore(
+ symbol
+ ^ font
+ )
)
+ Suppress(Literal("]")),
default = None
@@ -1881,12 +1890,13 @@
#~ print "non_math", toks
symbols = [Char(c, self.get_state()) for c in toks[0]]
hlist = Hlist(symbols)
+ # We're going into math now, so set font to 'it'
self.push_state()
- # We're going into math now, so set font to 'it'
self.get_state().font = 'it'
return [hlist]
def _make_space(self, percentage):
+ # All spaces are relative to em width
state = self.get_state()
metrics = state.font_output.get_metrics(
state.font, 'm', state.fontsize, state.dpi)
@@ -1910,12 +1920,12 @@
# print "symbol", toks
c = toks[0]
if c in self._spaced_symbols:
- return [Hlist([self._make_space(0.3),
- Char(c, self.get_state()),
- self._make_space(0.3)])]
+ return [Hlist( [self._make_space(0.2),
+ Char(c, self.get_state()),
+ self._make_space(0.2)] )]
elif c in self._punctuation_symbols:
- return [Hlist([Char(c, self.get_state()),
- self._make_space(0.3)])]
+ return [Hlist( [Char(c, self.get_state()),
+ self._make_space(0.2)] )]
try:
return [Char(toks[0], self.get_state())]
except ValueError:
@@ -1944,6 +1954,8 @@
state = self.get_state()
thickness = state.font_output.get_underline_thickness(
state.font, state.fontsize, state.dpi)
+ if len(toks[0]) != 2:
+ raise ParseFatalException("Error parsing accent")
accent, sym = toks[0]
accent = Accent(self._accent_map[accent], self.get_state())
centered = HCentered([accent])
@@ -2030,7 +2042,7 @@
super = next1
sub = next2
else:
- raise ParseFatalException("Subscript/superscript string is too long.")
+ raise ParseFatalException("Subscript/superscript sequence is too long.")
state = self.get_state()
rule_thickness = state.font_output.get_underline_thickness(
@@ -2052,17 +2064,17 @@
if super is not None:
hlist = HCentered([super])
hlist.hpack(width, 'exactly')
- vlist.extend([hlist, Vbox(0., rule_thickness * 2.0)])
+ vlist.extend([hlist, Kern(rule_thickness * 2.0)])
hlist = HCentered([nucleus])
hlist.hpack(width, 'exactly')
vlist.append(hlist)
if sub is not None:
hlist = HCentered([sub])
hlist.hpack(width, 'exactly')
- vlist.extend([Vbox(0., rule_thickness), hlist])
+ vlist.extend([Kern(rule_thickness * 2.0), hlist])
shift = hlist.height + hlist.depth + rule_thickness * 2.0
vlist = Vlist(vlist)
- vlist.shift_amount = shift
+ vlist.shift_amount = shift + nucleus.depth * 0.5
result = Hlist([vlist])
return [result]
@@ -2120,11 +2132,11 @@
width = max(num.width, den.width) + thickness * 10.
cnum.hpack(width, 'exactly')
cden.hpack(width, 'exactly')
- vlist = Vlist([cnum,
- Vbox(0, thickness * 2.0),
- Hrule(state),
- Vbox(0, thickness * 4.0),
- cden
+ vlist = Vlist([cnum, # numerator
+ Vbox(0, thickness * 2.0), # space
+ Hrule(state), # rule
+ Vbox(0, thickness * 4.0), # space
+ cden # denominator
])
# Shift so the fraction line sits in the middle of the
@@ -2149,35 +2161,42 @@
if root is None:
root = Box()
else:
+ if not isinstance(root, ParseResults):
+ raise ParseFatalException(
+ "Can not parse root of radical. Only simple symbols are allowed.")
+ root = Hlist(root.asList())
root.shrink()
root.shrink()
- # Add a little extra to the height so the body
- # doesn't seem cramped
+ # Determine the height of the body, and add a little extra to
+ # the height so it doesn't seem cramped
height = body.height - body.shift_amount + thickness * 5.0
depth = body.depth + body.shift_amount
check = AutoSizedDelim(r'\sqrt', height, depth, state, always=True)
-
height = check.height - check.shift_amount
depth = check.depth + check.shift_amount
+
+ # Put a little extra space to the left and right of the body
+ padded_body = Hlist([Hbox(thickness * 2.0),
+ body,
+ Hbox(thickness * 2.0)])
rightside = Vlist([Hrule(state),
Fill(),
- # Pack a little extra to the left and right
- # of the body
- Hlist([Hbox(thickness * 2.0),
- body,
- Hbox(thickness * 2.0)])])
+ padded_body])
# Stretch the glue between the hrule and the body
rightside.vpack(height + 1.0, depth, 'exactly')
+ # Add the root and shift it upward so it is above the tick.
+ # The value of 0.6 is a hard-coded hack ;)
root_vlist = Vlist([Hlist([root])])
root_vlist.shift_amount = -height * 0.6
- hlist = Hlist([root_vlist,
- Kern(-check.width * 0.5),
- check,
- Kern(-thickness * 0.3),
- rightside])
+ hlist = Hlist([root_vlist, # Root
+ # Negative kerning to put root over tick
+ Kern(-check.width * 0.5),
+ check, # Check
+ Kern(-thickness * 0.3), # Push check into rule slightly
+ rightside]) # Body
return [hlist]
def auto_sized_delimiter(self, s, loc, toks):
@@ -2187,6 +2206,7 @@
height = max([x.height for x in middle])
depth = max([x.depth for x in middle])
parts = []
+ # \left. and \right. aren't supposed to produce any symbols
if front != '.':
parts.append(AutoSizedDelim(front, height, depth, state))
parts.extend(middle.asList())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2007-07-30 20:45:13
|
Revision: 3637
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3637&view=rev
Author: mdboom
Date: 2007-07-30 13:45:09 -0700 (Mon, 30 Jul 2007)
Log Message:
-----------
Fix mathtext bug when svg.embed_char_paths is False
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2007-07-30 19:46:53 UTC (rev 3636)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2007-07-30 20:45:09 UTC (rev 3637)
@@ -375,7 +375,7 @@
new_y = - new_y_mtc
svg.append('<tspan style="font-size: %f; font-family: %s"' %
- (fontsize, fontname))
+ (fontsize, font.family_name))
xadvance = metrics.advance
svg.append(' textLength="%f"' % xadvance)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|