Created
March 24, 2019 17:08
-
-
Save Mahdisadjadi/54d658c820da5297c62c991c228f0fe3 to your computer and use it in GitHub Desktop.
Create a triangle and show label of vertices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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