Skip to content

Instantly share code, notes, and snippets.

@Mahdisadjadi
Created March 24, 2019 17:08
Show Gist options
  • Save Mahdisadjadi/54d658c820da5297c62c991c228f0fe3 to your computer and use it in GitHub Desktop.
Save Mahdisadjadi/54d658c820da5297c62c991c228f0fe3 to your computer and use it in GitHub Desktop.
Create a triangle and show label of vertices
# Create a triangle + label of vertices
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
fig, ax = plt.subplots(1,1,figsize=(5,5))
ax.plot(*coordinates[bonds].T, '-o', lw=3);
for i, p in enumerate(coordinates):
ax.text(*(p+[-0.03,0.06]), i, fontsize=15)
ax.axis("equal")
ax.set_axis_off()
plt.show(fig)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment