howto plt.subplots (projection='3d')?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

howto plt.subplots (projection='3d')?

Neal Becker
Any way to use plt.subplots for 3d?

This doesn't work:
  fig, axs = plt.subplots(nrows=opt.rcv_paths, ncols=1, sharex=True,
subplot_kw=dict(projection='3d'))
...
  File "/home/nbecker/.local/lib/python3.6/site-
packages/matplotlib/projections/__init__.py", line 67, in
get_projection_class
    raise ValueError("Unknown projection '%s'" % projection)
ValueError: Unknown projection '3d'

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: howto plt.subplots (projection='3d')?

Benjamin Root
You have to import the mplot3d toolkit first. That causes the 3d projection to get registered.

On Mon, Oct 2, 2017 at 2:03 PM, Neal Becker <[hidden email]> wrote:
Any way to use plt.subplots for 3d?

This doesn't work:
  fig, axs = plt.subplots(nrows=opt.rcv_paths, ncols=1, sharex=True,
subplot_kw=dict(projection='3d'))
...
  File "/home/nbecker/.local/lib/python3.6/site-
packages/matplotlib/projections/__init__.py", line 67, in
get_projection_class
    raise ValueError("Unknown projection '%s'" % projection)
ValueError: Unknown projection '3d'

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users