X Tutup
Skip to content

Matplotlib 3D projection axis cannot be created because of missing rcParam[u'_internal.classic_mode'] #8049

@alexhagen

Description

@alexhagen

Bug report

When trying to create a 3d projection axis using matplotlib mplot3d, I cannot set the projection because rcParams is missing the key u'_internal.classic_mode'. When trying to manually set rcParams['_internal.classic_mode'], I get an error that _internal.classic_mode is not a valid rcparameter.

Code for reproduction

Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> import matplotlib.pyplot as plt
>>> from mpl_toolkits.mplot3d import proj3d
>>> fig = plt.figure()
>>> ax = fig.gca(projection='3d')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/matplotlib/figure.py", line 1359, in gca
    return self.add_subplot(1, 1, 1, **kwargs)
  File "/usr/lib/python2.7/dist-packages/matplotlib/figure.py", line 1005, in add_subplot
    a = subplot_class_factory(projection_class)(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/matplotlib/axes/_subplots.py", line 73, in __init__
    self._axes_class.__init__(self, fig, self.figbox, **kwargs)
  File "/home/ahagen/.local/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 97, in __init__
    *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 508, in __init__
    self._init_axis()
  File "/home/ahagen/.local/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 195, in _init_axis
    self.xy_dataLim.intervalx, self)
  File "/home/ahagen/.local/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axis3d.py", line 83, in __init__
    if rcParams['_internal.classic_mode']:
  File "/usr/lib/python2.7/dist-packages/matplotlib/__init__.py", line 902, in __getitem__
    val = dict.__getitem__(self, key)
KeyError: u'_internal.classic_mode'
>>> plt.rcParams[u'_internal.classic_mode'] = True
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/matplotlib/__init__.py", line 888, in __setitem__
    See rcParams.keys() for a list of valid parameters.' % (key,))
KeyError: u'_internal.classic_mode is not a valid rc parameter.See rcParams.keys() for a list of valid parameters.'

Matplotlib version

>>> print matplotlib.__version__
1.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup