The following code plots points at the tips of a neuron skeleton, the coordinates of which are stored in coords
, and the colors of which are stored in tcolors
(which, for some reason, only colors the outline of the markers rather than the interior, creating another problem).
# Plot and color points at tips by path distance
for t, pts in enumerate(coords):
ax.scatter(pts[0], pts[1], pts[2], color=tcolors[t],
alpha=0.9, marker = 'o', s = 100)
Here is what it looks like:
https://gfycat.com/SkeletalFarawayBird
Unsurprisingly, the markers are circles (i.e. marker = 'o'). I am fully aware of how to change the marker into any of a number of 2D shapes (explained here), but I have no idea how to plot 3D shapes as markers in matplotlib.
My best solution is to manually, and rather inefficiently, plot spheres possessing origins at the specified coordinates. However, as is the reason why I am posting here, I am sure there is a better and, hopefully, matplotlib-native solution to this problem.