Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

point3d label axes

Hi,

I am completely new to sage (like only a few hours) and I am trying to create a labeled plot of the results from a PCA analysis.

here is what I am doing in the sage command line:

from matplotlib.mlab import PCA
pca_info=PCA(data)
a=point3d(pca_info.Wt[:3,])
a.show()

The problem is, I need to add labels to the axes to try and understand what the plot is giving. After googling a bit, I found people referring to

axes_labels(['x','y','z'])

But I when trying the following, I get an attribute error

a.axes_labels(['PCA1 (%0.3f)' %pca_info.fracs[0],
  'PCA2 (%0.3f)' %pca_info.fracs[1],
  'PCA3 (%0.3f)' %pca_info.fracs[2]])

How does one generally add labels to a 3d plot, specifically to point3d()? Or has my googling failed me, and the answer is so obvious that I completely missed it.