Wednesday, June 1, 2016

Label 3D Scatter Plots in Python

I work with grid data and sometimes I need to see the sequence in which nodes are ordered.

This can be done with annotate in 2D (see documentation) but not 3D.  Alternatively use "text"

ax.text(x[i], y[i], z[i] , "%s" % (str(i)), size=20, zorder=1, color = "black")

x,y,z are the location in 3-space, %s stores a string, str(i) converts "i" into a string and puts it in place of %s.

No comments: