Skip to content
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

3D projection in one subplot? #249

Closed
florian-wagner opened this issue Apr 8, 2021 · 2 comments
Closed

3D projection in one subplot? #249

florian-wagner opened this issue Apr 8, 2021 · 2 comments
Labels

Comments

@florian-wagner
Copy link

florian-wagner commented Apr 8, 2021

Hi @lukelbd,

first of all, thank you so much for developing proplot! It's a wonderful tool that would have saved me a lot of fiddling and boilerplate code in previous publications.

Quick question: Do you see any possibility to have one axis/subplot with matplotlib's 3D projection? I tried the following without success:

import matplotlib.pyplot as plt
import proplot as plot
import numpy as np

fig, axs = plot.subplots(nrows=1, ncols=4, width="20cm", sharex=3, sharey=3)

for a in axs[1:]:
    a.imshow(np.random.randn(5,5))

ax = fig.add_subplot(141, projection='3d')

image

Thanks and cheers,
Florian

@lukelbd
Copy link
Collaborator

lukelbd commented Jul 3, 2021

Decided to do this since the fix was relatively simple (6df344b). Now you can request a "3D" axes inside a proplot figure using the existing proj keyword.

Example: A single 3D axes

fig.subplots(proj='3d')

Example: 3 columns, the first one is a 3D axes

fig.subplots(ncols=3, proj={1: '3d'})

There will probably be other compatibility issues, but I think it's fair to at least add a baseline of support

@florian-wagner
Copy link
Author

Thanks a lot! Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants