Skip to content

Instantly share code, notes, and snippets.

@RyotaBannai
Created December 19, 2018 16:24
Show Gist options
  • Select an option

  • Save RyotaBannai/7f8104791d2ee16fd7b51de66c0ae59f to your computer and use it in GitHub Desktop.

Select an option

Save RyotaBannai/7f8104791d2ee16fd7b51de66c0ae59f to your computer and use it in GitHub Desktop.
ax = plt.gca()
ax.set_xlabel('X'); ax.set_ylabel('Y')
plt.scatter(X_raw[:, 0], X_raw[:, 1], c='#B8860B', alpha=0.5)
plt.scatter(X_mean[0], X_mean[1], c='red', s=50)
plt.axis('equal')
for length, vector in zip(e_values, V):
dir_ = -vector * 3 * np.sqrt(length) # Tweak the sign
start = X_mean; end = start + dir_
arrowprops = dict(arrowstyle='->',linewidth=2,
shrinkA=0, shrinkB=0, color='red', alpha=0.5)
ax.annotate('', xy=end, xytext=start, arrowprops=arrowprops)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment