Skip to content

Avoid using deprecated get_axis_bgcolor() method with newer matplotlib #292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 11, 2016

Conversation

WeatherGod
Copy link
Member

When plotting with newer versions of matplotlib, one gets a lot of deprecation warnings:

/rd22/scratch/broot/centos6/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py:1652: MatplotlibDeprecationWarning: The get_axis_bgcolor function was deprecated in version 2.0. Use get_facecolor instead.
  fill_color = ax.get_axis_bgcolor()
/rd22/scratch/broot/centos6/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py:1796: MatplotlibDeprecationWarning: The get_axis_bgcolor function was deprecated in version 2.0. Use get_facecolor instead.
  axisbgc = ax.get_axis_bgcolor()
/nas/home/broot/centos6/lib/python2.7/site-packages/matplotlib-1.5.1+1669.gbfe5e3f.dirty-py2.7-linux-x86_64.egg/matplotlib/cbook.py:137: MatplotlibDeprecationWarning: The axisbg attribute was deprecated in version 2.0. Use facecolor instead.
  warnings.warn(message, mplDeprecation, stacklevel=1)

This does a version check and uses the appropriate call instead. I think I found all instances of it.

There is still the annoying numpy warning, though:

/nas/home/broot/centos6/lib/python2.7/site-packages/numpy-1.12.0.dev0+e62aa19-py2.7-linux-x86_64.egg/numpy/ma/core.py:3192: FutureWarning: Currently, slicing will try to return a view of the data, but will return a copy of the mask. In the future, it will try to return both as views. This means that using `__setitem__` will propagate values back through all masks that are present.
  FutureWarning
/nas/home/broot/centos6/lib/python2.7/site-packages/numpy-1.12.0.dev0+e62aa19-py2.7-linux-x86_64.egg/numpy/ma/core.py:3113: FutureWarning: Currently, slicing will try to return a view of the data, but will return a copy of the mask. In the future, it will try to return both as views.
  FutureWarning

@WeatherGod WeatherGod merged commit becb291 into matplotlib:master May 11, 2016
@WeatherGod WeatherGod deleted the fix_bg_warning branch May 11, 2016 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant