Python matplotlib._all_deprecated() Examples

The following are 4 code examples of matplotlib._all_deprecated(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module matplotlib , or try the search function .
Example #1
Source File: test_rcparams.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def test_if_rctemplate_is_up_to_date():
    # This tests if the matplotlibrc.template file contains all valid rcParams.
    deprecated = {*mpl._all_deprecated, *mpl._deprecated_remain_as_none}
    path_to_rc = os.path.join(mpl.get_data_path(), 'matplotlibrc')
    with open(path_to_rc, "r") as f:
        rclines = f.readlines()
    missing = {}
    for k, v in mpl.defaultParams.items():
        if k[0] == "_":
            continue
        if k in deprecated:
            continue
        if k.startswith(
                ("verbose.", "examples.directory", "text.latex.unicode")):
            continue
        found = False
        for line in rclines:
            if k in line:
                found = True
        if not found:
            missing.update({k: v})
    if missing:
        raise ValueError("The following params are missing in the "
                         "matplotlibrc.template file: {}"
                         .format(missing.items())) 
Example #2
Source File: test_rcparams.py    From coffeegrindsize with MIT License 6 votes vote down vote up
def test_if_rctemplate_is_up_to_date():
    # This tests if the matplotlibrc.template file contains all valid rcParams.
    deprecated = {*mpl._all_deprecated, *mpl._deprecated_remain_as_none}
    path_to_rc = os.path.join(mpl.get_data_path(), 'matplotlibrc')
    with open(path_to_rc, "r") as f:
        rclines = f.readlines()
    missing = {}
    for k, v in mpl.defaultParams.items():
        if k[0] == "_":
            continue
        if k in deprecated:
            continue
        if k.startswith(
                ("verbose.", "examples.directory", "text.latex.unicode")):
            continue
        found = False
        for line in rclines:
            if k in line:
                found = True
        if not found:
            missing.update({k: v})
    if missing:
        raise ValueError("The following params are missing in the "
                         "matplotlibrc.template file: {}"
                         .format(missing.items())) 
Example #3
Source File: theme_matplotlib.py    From plotnine with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, rc=None, fname=None, use_defaults=True):
        theme.__init__(
            self,
            aspect_ratio=get_option('aspect_ratio'),
            dpi=get_option('dpi'),
            figure_size=get_option('figure_size'),
            legend_key=element_rect(fill='None', colour='None'),
            legend_key_size=16,
            panel_spacing=0.1,
            strip_background=element_rect(
                fill='#D9D9D9', color='#D9D9D9', size=1),
            complete=True)

        if use_defaults:
            _copy = mpl.rcParams.copy()
            deprecated_rcparams = (
                set(mpl._deprecated_remain_as_none)
                | set(mpl._all_deprecated)
            )
            # no need to a get a deprecate warning just because
            # they are still included in rcParams...
            for key in deprecated_rcparams:
                if key in _copy:
                    del _copy[key]
            if 'tk.pythoninspect' in _copy:
                del _copy['tk.pythoninspect']
            self._rcParams.update(_copy)

        if fname:
            self._rcParams.update(mpl.rc_params_from_file(fname))
        if rc:
            self._rcParams.update(rc) 
Example #4
Source File: test_rcparams.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def test_if_rctemplate_is_up_to_date():
    # This tests if the matplotlibrc.template file
    # contains all valid rcParams.
    dep1 = mpl._all_deprecated
    dep2 = mpl._deprecated_set
    deprecated = list(dep1.union(dep2))
    path_to_rc = os.path.join(mpl.get_data_path(), 'matplotlibrc')
    with open(path_to_rc, "r") as f:
        rclines = f.readlines()
    missing = {}
    for k, v in mpl.defaultParams.items():
        if k[0] == "_":
            continue
        if k in deprecated:
            continue
        if "verbose" in k:
            continue
        found = False
        for line in rclines:
            if k in line:
                found = True
        if not found:
            missing.update({k: v})
    if missing:
        raise ValueError("The following params are missing " +
                         "in the matplotlibrc.template file: {}"
                         .format(missing.items()))