Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 517513f

Browse files
committed
minor changes for htdocs
svn path=/trunk/matplotlib/; revision=4504
1 parent 4a5c982 commit 517513f

2 files changed

Lines changed: 30 additions & 18 deletions

File tree

examples/mathtext_examples.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,15 @@
4949
r'$\widehat{abc}\widetilde{def}$',
5050
r'$\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega$',
5151
r'$\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \lambda \mu \nu \xi \pi \kappa \rho \sigma \tau \upsilon \phi \chi \psi$',
52+
<<<<<<< .mine
53+
<<<<<<< .mine
54+
#ur'Generic symbol: $\u23ce \mathrm{\ue0f2}$'
55+
=======
56+
#ur'Generic symbol: $\u23ce \mathrm{\ue0f2 \U0001D538}$'
57+
=======
5258
ur'Generic symbol: $\u23ce \mathrm{\ue0f2 \U0001D538}$'
59+
>>>>>>> .r4393
60+
>>>>>>> .r4174
5361
]
5462

5563
from pylab import *
@@ -63,7 +71,11 @@ def doall():
6371
axis([0, 3, -len(tests), 0])
6472
yticks(arange(len(tests)) * -1)
6573
for i, s in enumerate(tests):
74+
<<<<<<< .mine
75+
print i,s
76+
=======
6677
print (i, s)
78+
>>>>>>> .r4174
6779
text(0.1, -i, s, fontsize=20)
6880

6981
savefig('mathtext_examples')

lib/matplotlib/mathtext.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ def get_underline_thickness(self, font, fontsize, dpi):
10921092
# Typesetting math formulas
10931093
#
10941094
# Many of the docstrings below refer to a numbered "node" in that
1095-
# book, e.g. @123
1095+
# book, e.g. node123
10961096
#
10971097
# Note that (as TeX) y increases downward, unlike many other parts of
10981098
# matplotlib.
@@ -1120,7 +1120,7 @@ class MathTextWarning(Warning):
11201120

11211121
class Node(object):
11221122
"""A node in the TeX box model
1123-
@133
1123+
node133
11241124
"""
11251125
def __init__(self):
11261126
self.size = 0
@@ -1149,7 +1149,7 @@ def render(self, x, y):
11491149

11501150
class Box(Node):
11511151
"""Represents any node with a physical location.
1152-
@135"""
1152+
node135"""
11531153
def __init__(self, width, height, depth):
11541154
Node.__init__(self)
11551155
self.width = width
@@ -1195,7 +1195,7 @@ class Char(Node):
11951195
The metrics must be converted to the TeX way, and the advance (if
11961196
different from width) must be converted into a Kern node when the
11971197
Char is added to its parent Hlist.
1198-
@134"""
1198+
node134"""
11991199
def __init__(self, c, state):
12001200
Node.__init__(self)
12011201
self.c = c
@@ -1286,7 +1286,7 @@ def render(self, x, y):
12861286

12871287
class List(Box):
12881288
"""A list of nodes (either horizontal or vertical).
1289-
@135"""
1289+
node135"""
12901290
def __init__(self, elements):
12911291
Box.__init__(self, 0., 0., 0.)
12921292
self.shift_amount = 0. # An arbitrary offset
@@ -1344,7 +1344,7 @@ def grow(self):
13441344

13451345
class Hlist(List):
13461346
"""A horizontal list of boxes.
1347-
@135"""
1347+
node135"""
13481348
def __init__(self, elements, w=0., m='additional', do_kern=True):
13491349
List.__init__(self, elements)
13501350
if do_kern:
@@ -1387,7 +1387,7 @@ def hpack(self, w=0., m='additional'):
13871387
Thus, hpack(w, exactly) produces a box whose width is exactly w, while
13881388
hpack (w, additional ) yields a box whose width is the natural width
13891389
plus w. The default values produce a box with the natural width.
1390-
@644, @649"""
1390+
node644, node649"""
13911391
# I don't know why these get reset in TeX. Shift_amount is pretty
13921392
# much useless if we do.
13931393
#self.shift_amount = 0.
@@ -1434,7 +1434,7 @@ def hpack(self, w=0., m='additional'):
14341434

14351435
class Vlist(List):
14361436
"""A vertical list of boxes.
1437-
@137"""
1437+
node137"""
14381438
def __init__(self, elements, h=0., m='additional'):
14391439
List.__init__(self, elements)
14401440
self.vpack()
@@ -1451,7 +1451,7 @@ def vpack(self, h=0., m='additional', l=float(inf)):
14511451
Thus, vpack(h, exactly) produces a box whose width is exactly w, while
14521452
vpack(w, additional) yields a box whose width is the natural width
14531453
plus w. The default values produce a box with the natural width.
1454-
@644, @668"""
1454+
node644, node668"""
14551455
# I don't know why these get reset in TeX. Shift_amount is pretty
14561456
# much useless if we do.
14571457
# self.shift_amount = 0.
@@ -1510,7 +1510,7 @@ class Rule(Box):
15101510
rule up to the boundary of the innermost enclosing box. This is called
15111511
a "running dimension." The width is never running in an Hlist; the
15121512
height and depth are never running in a Vlist.
1513-
@138"""
1513+
node138"""
15141514
def __init__(self, width, height, depth, state):
15151515
Box.__init__(self, width, height, depth)
15161516
self.font_output = state.font_output
@@ -1538,7 +1538,7 @@ class Glue(Node):
15381538
GlueSpec class, which is shared between multiple glue objects. (This
15391539
is a memory optimization which probably doesn't matter anymore, but it's
15401540
easier to stick to what TeX does.)
1541-
@149, @152"""
1541+
node149, node152"""
15421542
def __init__(self, glue_type, copy=False):
15431543
Node.__init__(self)
15441544
self.glue_subtype = 'normal'
@@ -1566,7 +1566,7 @@ def grow(self):
15661566
self.glue_spec.width *= GROW_FACTOR
15671567

15681568
class GlueSpec(object):
1569-
"""@150, @151"""
1569+
"""node150, node151"""
15701570
def __init__(self, width=0., stretch=0., stretch_order=0, shrink=0., shrink_order=0):
15711571
self.width = width
15721572
self.stretch = stretch
@@ -1647,7 +1647,7 @@ class Kern(Node):
16471647
better to move them closer together or further apart. A kern node can
16481648
also appear in a vertical list, when its 'width' denotes additional
16491649
spacing in the vertical direction.
1650-
@155"""
1650+
node155"""
16511651
def __init__(self, width):
16521652
Node.__init__(self)
16531653
self.width = width
@@ -1733,7 +1733,7 @@ class Ship(object):
17331733
and vlist_out , which traverse the Hlists and Vlists inside of
17341734
horizontal and vertical boxes. The global variables used in TeX to
17351735
store state as it processes have become member variables here.
1736-
@592."""
1736+
node592."""
17371737
def __call__(self, ox, oy, box):
17381738
self.max_push = 0 # Deepest nesting of push commands so far
17391739
self.cur_s = 0
@@ -1769,7 +1769,7 @@ def hlist_out(self, box):
17691769
elif isinstance(p, Kern):
17701770
self.cur_h += p.width
17711771
elif isinstance(p, List):
1772-
# @623
1772+
# node623
17731773
if len(p.children) == 0:
17741774
self.cur_h += p.width
17751775
else:
@@ -1783,7 +1783,7 @@ def hlist_out(self, box):
17831783
self.cur_h = edge + p.width
17841784
self.cur_v = base_line
17851785
elif isinstance(p, Box):
1786-
# @624
1786+
# node624
17871787
rule_height = p.height
17881788
rule_depth = p.depth
17891789
rule_width = p.width
@@ -1799,7 +1799,7 @@ def hlist_out(self, box):
17991799
self.cur_v = baseline
18001800
self.cur_h += rule_width
18011801
elif isinstance(p, Glue):
1802-
# @625
1802+
# node625
18031803
glue_spec = p.glue_spec
18041804
rule_width = glue_spec.width - cur_g
18051805
if glue_sign != 0: # normal
@@ -2470,7 +2470,7 @@ def subsuperscript(self, s, loc, toks):
24702470
else:
24712471
shift_down = SUBDROP * xHeight
24722472
if super is None:
2473-
# @757
2473+
# node757
24742474
sub.shrink()
24752475
x = Hlist([sub])
24762476
# x.width += SCRIPT_SPACE * xHeight

0 commit comments

Comments
 (0)