GeezerVison is showing github.com — incomplete data in mpl_toolkits.mplot3d.art3d.Path3DCollection · Issue #7243 · matplotlib/matplotlib
incomplete data in mpl_toolkits.mplot3d.art3d.Path3DCollection #7243DescriptionAfter 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. ActivityWeatherGod commented on Oct 10, 2016 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 commented on Oct 10, 2016 ContributorAuthor More actions If there is no other method for extracting the data, I'd vote for it. added this to the This milestone has been deleted milestone on Oct 10, 2016nschloe commented on May 26, 2017 ContributorAuthor More actions Any chance of this happening? WeatherGod commented on May 26, 2017 Anything is possible. It is just a question of someone putting their mind
to implementing it.
What if we came up with a name for a method that would act as the
"get_data()" for any artist? So, for 2D path collections, it would be
get_offsets(), for images, it would be the image data, for 3d paths, it
would be the untransformed 3d offsets? (note, get_data() is already taken).
This is a MEP-worthy task, and once a MEP is made, it makes it much more
likely it'll get implemented.
…nschloe commented on Jun 2, 2017 ContributorAuthor More actions What does MEP mean?
I like the idea of a unifying get_data method. Perhaps get_raw_data would be appropriate. WeatherGod commented on Jun 5, 2017 modified the milestones: This milestone has been deleted, This milestone has been deleted on Sep 24, 2017cherry-ball commented on 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 commented on Feb 1, 2020 I had the same issue and simply used the property _offsets3d as a workaround, see here github-actions commented on Mar 31, 2023 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! nschloe commented on Mar 31, 2023 ContributorAuthor More actions Still present, feature still requested. Reacted by Paulo, Alberto Fabbri, Marijn, brechtevens, Samuel, Roberto Hueso, Thomas Storek and Leander Claes
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|