Skip to content

Commit

Permalink
Merge branch 'v2.0.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
QuLogic committed Jan 30, 2017
2 parents f7596e9 + fe1641b commit c6e5515
Show file tree
Hide file tree
Showing 24 changed files with 819 additions and 24 deletions.
2 changes: 2 additions & 0 deletions doc/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Overview
:Release: |version|
:Date: |today|

Download `PDF <Matplotlib.pdf>`_


.. toctree::
:maxdepth: 2
Expand Down
6 changes: 6 additions & 0 deletions doc/users/whats_new/deprecations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Deprecations
------------

- The "Vega" colormaps are deprecated in Matplotlib 2.0.1 and will be removed
in Matplotlib 2.2. Use the "tab" colormaps instead: "tab10", "tab20",
"tab20b", "tab20c".
4 changes: 2 additions & 2 deletions examples/color/colormaps_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral',
'seismic']),
('Qualitative', ['Accent', 'Dark2', 'Paired', 'Pastel1',
'Pastel2', 'Set1', 'Set2', 'Set3', 'Vega10',
'Vega20', 'Vega20b', 'Vega20c']),
'Pastel2', 'Set1', 'Set2', 'Set3', 'tab10',
'tab20', 'tab20b', 'tab20c']),
('Miscellaneous', ['gist_earth', 'terrain', 'ocean', 'gist_stern',
'brg', 'CMRmap', 'cubehelix',
'gnuplot', 'gnuplot2', 'gist_ncar',
Expand Down
1 change: 1 addition & 0 deletions examples/style_sheets/plot_bmh.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from numpy.random import beta
import matplotlib.pyplot as plt


plt.style.use('bmh')


Expand Down
3 changes: 1 addition & 2 deletions examples/style_sheets/plot_fivethirtyeight.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
tries to replicate the styles from FiveThirtyEight.com.
"""


from matplotlib import pyplot as plt
import numpy as np


plt.style.use('fivethirtyeight')

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


plt.show()
2 changes: 1 addition & 1 deletion lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1505,8 +1505,8 @@ def _init_tests():
"Expected freetype version {0}. "
"Found freetype version {1}. "
"Freetype build type is {2}local".format(
ft2font.__freetype_version__,
LOCAL_FREETYPE_VERSION,
ft2font.__freetype_version__,
"" if ft2font.__freetype_build_type__ == 'local' else "not "
)
)
Expand Down
30 changes: 22 additions & 8 deletions lib/matplotlib/_cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ def gfunc32(x):
# (divided by 255)
#

_Vega10_data = (
_tab10_data = (
(0.12156862745098039, 0.4666666666666667, 0.7058823529411765 ), # 1f77b4
(1.0, 0.4980392156862745, 0.054901960784313725), # ff7f0e
(0.17254901960784313, 0.6274509803921569, 0.17254901960784313 ), # 2ca02c
Expand All @@ -1296,7 +1296,7 @@ def gfunc32(x):
(0.09019607843137255, 0.7450980392156863, 0.8117647058823529), # 17becf
)

_Vega20_data = (
_tab20_data = (
(0.12156862745098039, 0.4666666666666667, 0.7058823529411765 ), # 1f77b4
(0.6823529411764706, 0.7803921568627451, 0.9098039215686274 ), # aec7e8
(1.0, 0.4980392156862745, 0.054901960784313725), # ff7f0e
Expand All @@ -1319,7 +1319,7 @@ def gfunc32(x):
(0.6196078431372549, 0.8549019607843137, 0.8980392156862745), # 9edae5
)

_Vega20b_data = (
_tab20b_data = (
(0.2235294117647059, 0.23137254901960785, 0.4745098039215686 ), # 393b79
(0.3215686274509804, 0.32941176470588235, 0.6392156862745098 ), # 5254a3
(0.4196078431372549, 0.43137254901960786, 0.8117647058823529 ), # 6b6ecf
Expand All @@ -1342,7 +1342,7 @@ def gfunc32(x):
(0.8705882352941177, 0.6196078431372549, 0.8392156862745098 ), # de9ed6
)

_Vega20c_data = (
_tab20c_data = (
(0.19215686274509805, 0.5098039215686274, 0.7411764705882353 ), # 3182bd
(0.4196078431372549, 0.6823529411764706, 0.8392156862745098 ), # 6baed6
(0.6196078431372549, 0.792156862745098, 0.8823529411764706 ), # 9ecae1
Expand Down Expand Up @@ -1380,6 +1380,15 @@ def __getitem__(self, key):
alternative="nipy_spectral and nipy_spectral_r",
obj_type="colormap"
)
elif key in ["Vega10", "Vega10_r", "Vega20", "Vega20_r", "Vega20b",
"Vega20b_r", "Vega20c", "Vega20c_r"]:
warn_deprecated(
"2.0",
name="Vega colormaps",
alternative="tab",
obj_type="colormap"
)

return super(_deprecation_datad, self).__getitem__(key)


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

datad['Vega10'] = {'listed': _Vega10_data}
datad['Vega20'] = {'listed': _Vega20_data}
datad['Vega20b'] = {'listed': _Vega20b_data}
datad['Vega20c'] = {'listed': _Vega20c_data}
datad['tab10'] = {'listed': _tab10_data}
datad['tab20'] = {'listed': _tab20_data}
datad['tab20b'] = {'listed': _tab20b_data}
datad['tab20c'] = {'listed': _tab20c_data}

datad['Vega10'] = {'listed': _tab10_data}
datad['Vega20'] = {'listed': _tab20_data}
datad['Vega20b'] = {'listed': _tab20b_data}
datad['Vega20c'] = {'listed': _tab20c_data}
19 changes: 8 additions & 11 deletions lib/matplotlib/mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -2877,21 +2877,18 @@ def subsuper(self, s, loc, toks):
return toks[0] # .asList()
else:
nucleus = toks[0]
elif len(toks) == 2:
op, next = toks
nucleus = Hbox(0.0)
if op == '_':
sub = next
else:
super = next
elif len(toks) == 3:
nucleus, op, next = toks
elif len(toks) in (2, 3):
# single subscript or superscript
nucleus = toks[0] if len(toks) == 3 else Hbox(0.0)
op, next = toks[-2:]
if op == '_':
sub = next
else:
super = next
elif len(toks) == 5:
nucleus, op1, next1, op2, next2 = toks
elif len(toks) in (4, 5):
# subscript and superscript
nucleus = toks[0] if len(toks) == 5 else Hbox(0.0)
op1, next1, op2, next2 = toks[-4:]
if op1 == op2:
if op1 == '_':
raise ParseFatalException("Double subscript")
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
222 changes: 222 additions & 0 deletions lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_cm_81.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c6e5515

Please sign in to comment.