Skip to content

Commit c6e5515

Browse files
committed
Merge branch 'v2.0.x'
2 parents f7596e9 + fe1641b commit c6e5515

24 files changed

+819
-24
lines changed

doc/contents.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Overview
88
:Release: |version|
99
:Date: |today|
1010

11+
Download `PDF <Matplotlib.pdf>`_
12+
1113

1214
.. toctree::
1315
:maxdepth: 2

doc/users/whats_new/deprecations.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Deprecations
2+
------------
3+
4+
- The "Vega" colormaps are deprecated in Matplotlib 2.0.1 and will be removed
5+
in Matplotlib 2.2. Use the "tab" colormaps instead: "tab10", "tab20",
6+
"tab20b", "tab20c".

examples/color/colormaps_reference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral',
5656
'seismic']),
5757
('Qualitative', ['Accent', 'Dark2', 'Paired', 'Pastel1',
58-
'Pastel2', 'Set1', 'Set2', 'Set3', 'Vega10',
59-
'Vega20', 'Vega20b', 'Vega20c']),
58+
'Pastel2', 'Set1', 'Set2', 'Set3', 'tab10',
59+
'tab20', 'tab20b', 'tab20c']),
6060
('Miscellaneous', ['gist_earth', 'terrain', 'ocean', 'gist_stern',
6161
'brg', 'CMRmap', 'cubehelix',
6262
'gnuplot', 'gnuplot2', 'gist_ncar',

examples/style_sheets/plot_bmh.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from numpy.random import beta
1313
import matplotlib.pyplot as plt
1414

15+
1516
plt.style.use('bmh')
1617

1718

examples/style_sheets/plot_fivethirtyeight.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
tries to replicate the styles from FiveThirtyEight.com.
88
"""
99

10-
1110
from matplotlib import pyplot as plt
1211
import numpy as np
1312

13+
1414
plt.style.use('fivethirtyeight')
1515

1616
x = np.linspace(0, 10)
@@ -28,5 +28,4 @@
2828
ax.plot(x, np.sin(x) + np.random.randn(50))
2929
ax.set_title("'fivethirtyeight' style sheet")
3030

31-
3231
plt.show()

lib/matplotlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1505,8 +1505,8 @@ def _init_tests():
15051505
"Expected freetype version {0}. "
15061506
"Found freetype version {1}. "
15071507
"Freetype build type is {2}local".format(
1508-
ft2font.__freetype_version__,
15091508
LOCAL_FREETYPE_VERSION,
1509+
ft2font.__freetype_version__,
15101510
"" if ft2font.__freetype_build_type__ == 'local' else "not "
15111511
)
15121512
)

lib/matplotlib/_cm.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ def gfunc32(x):
12831283
# (divided by 255)
12841284
#
12851285

1286-
_Vega10_data = (
1286+
_tab10_data = (
12871287
(0.12156862745098039, 0.4666666666666667, 0.7058823529411765 ), # 1f77b4
12881288
(1.0, 0.4980392156862745, 0.054901960784313725), # ff7f0e
12891289
(0.17254901960784313, 0.6274509803921569, 0.17254901960784313 ), # 2ca02c
@@ -1296,7 +1296,7 @@ def gfunc32(x):
12961296
(0.09019607843137255, 0.7450980392156863, 0.8117647058823529), # 17becf
12971297
)
12981298

1299-
_Vega20_data = (
1299+
_tab20_data = (
13001300
(0.12156862745098039, 0.4666666666666667, 0.7058823529411765 ), # 1f77b4
13011301
(0.6823529411764706, 0.7803921568627451, 0.9098039215686274 ), # aec7e8
13021302
(1.0, 0.4980392156862745, 0.054901960784313725), # ff7f0e
@@ -1319,7 +1319,7 @@ def gfunc32(x):
13191319
(0.6196078431372549, 0.8549019607843137, 0.8980392156862745), # 9edae5
13201320
)
13211321

1322-
_Vega20b_data = (
1322+
_tab20b_data = (
13231323
(0.2235294117647059, 0.23137254901960785, 0.4745098039215686 ), # 393b79
13241324
(0.3215686274509804, 0.32941176470588235, 0.6392156862745098 ), # 5254a3
13251325
(0.4196078431372549, 0.43137254901960786, 0.8117647058823529 ), # 6b6ecf
@@ -1342,7 +1342,7 @@ def gfunc32(x):
13421342
(0.8705882352941177, 0.6196078431372549, 0.8392156862745098 ), # de9ed6
13431343
)
13441344

1345-
_Vega20c_data = (
1345+
_tab20c_data = (
13461346
(0.19215686274509805, 0.5098039215686274, 0.7411764705882353 ), # 3182bd
13471347
(0.4196078431372549, 0.6823529411764706, 0.8392156862745098 ), # 6baed6
13481348
(0.6196078431372549, 0.792156862745098, 0.8823529411764706 ), # 9ecae1
@@ -1380,6 +1380,15 @@ def __getitem__(self, key):
13801380
alternative="nipy_spectral and nipy_spectral_r",
13811381
obj_type="colormap"
13821382
)
1383+
elif key in ["Vega10", "Vega10_r", "Vega20", "Vega20_r", "Vega20b",
1384+
"Vega20b_r", "Vega20c", "Vega20c_r"]:
1385+
warn_deprecated(
1386+
"2.0",
1387+
name="Vega colormaps",
1388+
alternative="tab",
1389+
obj_type="colormap"
1390+
)
1391+
13831392
return super(_deprecation_datad, self).__getitem__(key)
13841393

13851394

@@ -1465,7 +1474,12 @@ def __getitem__(self, key):
14651474
datad['Set2'] = {'listed': _Set2_data}
14661475
datad['Set3'] = {'listed': _Set3_data}
14671476

1468-
datad['Vega10'] = {'listed': _Vega10_data}
1469-
datad['Vega20'] = {'listed': _Vega20_data}
1470-
datad['Vega20b'] = {'listed': _Vega20b_data}
1471-
datad['Vega20c'] = {'listed': _Vega20c_data}
1477+
datad['tab10'] = {'listed': _tab10_data}
1478+
datad['tab20'] = {'listed': _tab20_data}
1479+
datad['tab20b'] = {'listed': _tab20b_data}
1480+
datad['tab20c'] = {'listed': _tab20c_data}
1481+
1482+
datad['Vega10'] = {'listed': _tab10_data}
1483+
datad['Vega20'] = {'listed': _tab20_data}
1484+
datad['Vega20b'] = {'listed': _tab20b_data}
1485+
datad['Vega20c'] = {'listed': _tab20c_data}

lib/matplotlib/mathtext.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,21 +2877,18 @@ def subsuper(self, s, loc, toks):
28772877
return toks[0] # .asList()
28782878
else:
28792879
nucleus = toks[0]
2880-
elif len(toks) == 2:
2881-
op, next = toks
2882-
nucleus = Hbox(0.0)
2883-
if op == '_':
2884-
sub = next
2885-
else:
2886-
super = next
2887-
elif len(toks) == 3:
2888-
nucleus, op, next = toks
2880+
elif len(toks) in (2, 3):
2881+
# single subscript or superscript
2882+
nucleus = toks[0] if len(toks) == 3 else Hbox(0.0)
2883+
op, next = toks[-2:]
28892884
if op == '_':
28902885
sub = next
28912886
else:
28922887
super = next
2893-
elif len(toks) == 5:
2894-
nucleus, op1, next1, op2, next2 = toks
2888+
elif len(toks) in (4, 5):
2889+
# subscript and superscript
2890+
nucleus = toks[0] if len(toks) == 5 else Hbox(0.0)
2891+
op1, next1, op2, next2 = toks[-4:]
28952892
if op1 == op2:
28962893
if op1 == '_':
28972894
raise ParseFatalException("Double subscript")
Binary file not shown.
Lines changed: 222 additions & 0 deletions
Loading
Binary file not shown.

0 commit comments

Comments
 (0)