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

Skip to content

Commit 24ceac9

Browse files
committed
Merged revisions 4867-4911 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint ........ r4874 | jdh2358 | 2008-01-16 23:13:27 -0500 (Wed, 16 Jan 2008) | 1 line forced nonunicode fname for save in agg ........ r4879 | mdboom | 2008-01-18 12:59:51 -0500 (Fri, 18 Jan 2008) | 2 lines Fix poly_editor.py ........ r4882 | mdboom | 2008-01-21 14:03:48 -0500 (Mon, 21 Jan 2008) | 2 lines Fix bug with pie chart slices less than 2.5 degrees. ........ r4896 | efiring | 2008-01-25 19:11:36 -0500 (Fri, 25 Jan 2008) | 2 lines Apply patch by Manuel Metz to scatter docstring. ........ r4904 | jrevans | 2008-01-28 13:02:31 -0500 (Mon, 28 Jan 2008) | 4 lines Fixed a bug where plotting a singe point unitized errorbar data would fail. Fixed a bug where plotting errorbar data where the error is a duration for a time valued axes would fail. ........ r4907 | mdboom | 2008-01-29 15:24:58 -0500 (Tue, 29 Jan 2008) | 1 line Allow updating of shared axes when calling Axes.axis() (Thanks Jorgen Stenarson) ........ r4911 | mdboom | 2008-01-31 10:21:10 -0500 (Thu, 31 Jan 2008) | 2 lines Fix \sqrt with a numeric radical. ........ svn path=/trunk/matplotlib/; revision=4912
1 parent 895f6fb commit 24ceac9

4 files changed

Lines changed: 31 additions & 24 deletions

File tree

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2008-01-31 Fix \sqrt with radical number (broken by making [ and ]
2+
work below) - MGD
3+
14
2008-01-27 Applied Martin Teichmann's patch to improve the Qt4
25
backend. Uses Qt's builtin toolbars and statusbars.
36
See bug 1828848 - DSD

examples/mathtext_examples.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
r"$f^'$",
4141
r'$\frac{x_2888}{y}$',
4242
r"$\sqrt[3]{\frac{X_2}{Y}}=5$",
43-
r"$\sqrt[5x\pi]{\prod^\frac{x}{2\pi^2}_\infty}$",
43+
r"$\sqrt[5]{\prod^\frac{x}{2\pi^2}_\infty}$",
4444
r"$\sqrt[3]{x}=5$",
4545
r'$\frac{X}{\frac{X}{Y}}$',
4646
# From UTR #25
@@ -56,7 +56,7 @@
5656

5757
def doall():
5858
tests = stests
59-
59+
6060
figure(figsize=(8, (len(tests) * 1) + 2))
6161
plot([0, 0], 'r')
6262
grid(False)
@@ -69,7 +69,7 @@ def doall():
6969
savefig('mathtext_examples')
7070
#close('all')
7171
show()
72-
72+
7373
if '--latex' in sys.argv:
7474
fd = open("mathtext_examples.ltx", "w")
7575
fd.write("\\documentclass{article}\n")

lib/matplotlib/axes.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,10 +2641,6 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
26412641
ymin = npy.asarray(ymin)
26422642
ymax = npy.asarray(ymax)
26432643

2644-
if len(ymin)==1:
2645-
ymin = ymin*npy.ones(x.shape, x.dtype)
2646-
if len(ymax)==1:
2647-
ymax = ymax*npy.ones(x.shape, x.dtype)
26482644

26492645
if len(ymin)!=len(x):
26502646
raise ValueError, 'ymin and x are unequal sized sequences'
@@ -2661,12 +2657,17 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
26612657
self.add_collection(coll)
26622658
coll.update(kwargs)
26632659

2664-
minx = x.min()
2665-
maxx = x.max()
2666-
miny = min(ymin.min(), ymax.min())
2667-
maxy = max(ymin.max(), ymax.max())
2668-
minx, maxx = self.convert_xunits((minx, maxx))
2669-
miny, maxy = self.convert_yunits((miny, maxy))
2660+
# We do the conversion first since not all unitized data is uniform
2661+
xx = self.convert_xunits( x )
2662+
yymin = self.convert_yunits( ymin )
2663+
yymax = self.convert_yunits( ymax )
2664+
2665+
minx = min( xx )
2666+
maxx = max( xx )
2667+
2668+
miny = min( min(yymin), min(yymax) )
2669+
maxy = max( max(yymin), max(yymax) )
2670+
26702671
corners = (minx, miny), (maxx, maxy)
26712672
self.update_datalim(corners)
26722673
self.autoscale_view()
@@ -4162,6 +4163,18 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
41624163
41634164
angle is the angle of rotation of the symbol
41644165
4166+
Finally, marker can be (verts, 0), verts is a sequence of (x,y)
4167+
vertices for a custom scatter symbol.
4168+
4169+
numsides is the number of sides
4170+
4171+
style is the style of the regular symbol:
4172+
0 : a regular polygon
4173+
1 : a star-like symbol
4174+
2 : an asterisk
4175+
4176+
angle is the angle of rotation of the symbol
4177+
41654178
Finally, marker can be (verts, 0), verts is a sequence of (x,y)
41664179
vertices for a custom scatter symbol.
41674180

lib/matplotlib/mathtext.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,12 +2102,7 @@ def __init__(self):
21022102
Suppress(Literal(r"\sqrt"))
21032103
+ Optional(
21042104
Suppress(Literal("["))
2105-
+ Group(
2106-
OneOrMore(
2107-
(c_over_c | symbol)
2108-
^ font
2109-
)
2110-
)
2105+
+ Regex("[0-9]+")
21112106
+ Suppress(Literal("]")),
21122107
default = None
21132108
)
@@ -2595,11 +2590,7 @@ def sqrt(self, s, loc, toks):
25952590
if root is None:
25962591
root = Box(0., 0., 0.)
25972592
else:
2598-
if not isinstance(root, ParseResults):
2599-
raise ParseFatalException(
2600-
"Can not parse root of radical. "
2601-
"Only simple symbols are allowed in the root.")
2602-
root = Hlist(root.asList())
2593+
root = Hlist([Char(x, state) for x in root])
26032594
root.shrink()
26042595
root.shrink()
26052596

0 commit comments

Comments
 (0)