Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Non string projection definitions #694

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

Closed
wants to merge 16 commits into from
Prev Previous commit
Next Next commit
reverted projections change.
  • Loading branch information
Phil Elson committed Feb 6, 2012
commit 40a0ec9e5db7ddb075907d869a38f111f3ccb5e5
16 changes: 4 additions & 12 deletions lib/matplotlib/projections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,10 @@ def get_projection_class(projection=None):
if projection is None:
projection = 'rectilinear'

if isinstance(projection, basestring):
try:
return projection_registry.get_projection_class(projection)
except KeyError:
raise ValueError("Unknown projection '%s'" % projection)

elif hasattr(projection, '_as_mpl_axes'):
projection_class, extra_kwargs = projection._as_mpl_axes()
kwargs.update(**extra_kwargs)
else:
TypeError('projection must be a string, None or implement a _as_mpl_axes method. Got %r' % projection)

try:
return projection_registry.get_projection_class(projection)
except KeyError:
raise ValueError("Unknown projection '%s'" % projection)


def projection_factory(projection, figure, rect, **kwargs):
Expand Down