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

incomplete data in mpl_toolkits.mplot3d.art3d.Path3DCollection #7243

Open
nschloe opened this issue Oct 9, 2016 · 10 comments
Open

incomplete data in mpl_toolkits.mplot3d.art3d.Path3DCollection #7243

nschloe opened this issue Oct 9, 2016 · 10 comments
Labels
API: consistency keep Items to be ignored by the “Stale” Github Action topic: mplot3d

Comments

@nschloe
Copy link
Contributor

nschloe commented Oct 9, 2016

After creating a mpl_toolkits.mplot3d.art3d.Path3DCollection, e.g.,

from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d.art3d import Path3DCollection
import numpy as np

pos = np.random.rand(3, 6)
print(pos.T)
fig = plt.figure()
ax = fig.add_subplot(projection='3d')
ax.scatter(pos[0], pos[1], pos[2], c=np.arange(pos.shape[1]))

I'd like to retrieve pos from the figure. As in 2D, I expected get_offsets to retrieve the data, but

for c in ax.get_children():
    if isinstance(c, Path3DCollection):
        print(c.get_offsets())

only returns the first two colums of pos.

@WeatherGod
Copy link
Member

The problem is that these methods are used by the backends, which all
expect 2D data, so it can't return 3D data. Perhaps a get_3doffsets()
method should be created?

On Sun, Oct 9, 2016 at 6:37 PM, Nico Schlömer [email protected]
wrote:

After creating a mpl_toolkits.mplot3d.art3d.Path3DCollection, e.g.,

from matplotlib import pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dfrom mpl_toolkits.mplot3d.art3d import Path3DCollectionimport numpy as np

pos = np.random.rand(3, 6)print(pos)
fig = plt.figure()
ax = plt.gca(projection='3d')
ax.scatter(pos[0], pos[1], pos[2], c=np.arange(pos.shape[1]))

I'd like to retrieve pos from the figure. As in 2D, I expected get_offsets
to retrieve the data, but

for c in ax.get_children():
if isinstance(c, Path3DCollection):
print
print(c.get_offsets())

only returns the first two colums of pos.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#7243, or mute the thread
https://github.com/notifications/unsubscribe-auth/AARy-J9Dq7H6wxJKS-5HVTxjmAm-VFfWks5qyWyVgaJpZM4KSIqR
.

@nschloe
Copy link
Contributor Author

nschloe commented Oct 10, 2016

If there is no other method for extracting the data, I'd vote for it.

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Oct 10, 2016
@nschloe
Copy link
Contributor Author

nschloe commented May 26, 2017

Any chance of this happening?

@WeatherGod
Copy link
Member

WeatherGod commented May 26, 2017 via email

@nschloe
Copy link
Contributor Author

nschloe commented Jun 2, 2017

What does MEP mean?

I like the idea of a unifying get_data method. Perhaps get_raw_data would be appropriate.

@WeatherGod
Copy link
Member

WeatherGod commented Jun 5, 2017 via email

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Sep 24, 2017
@cherry-ball
Copy link

cherry-ball commented Nov 7, 2017

I have the same problem and I want to know how to achieve it eventually? Would you please tell me? Thank you very much

@theRealSuperMario
Copy link

theRealSuperMario commented Feb 1, 2020

I had the same issue and simply used the property _offsets3d as a workaround, see here

@github-actions
Copy link

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Mar 31, 2023
@nschloe
Copy link
Contributor Author

nschloe commented Mar 31, 2023

Still present, feature still requested.

@oscargus oscargus added keep Items to be ignored by the “Stale” Github Action and removed status: inactive Marked by the “Stale” Github Action labels Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API: consistency keep Items to be ignored by the “Stale” Github Action topic: mplot3d
Projects
None yet
Development

No branches or pull requests

6 participants