diff --git a/plots/treeplot.png b/plots/treeplot.png new file mode 100644 index 0000000000000000000000000000000000000000..6f6f7a84769e89445fa7a21f8d9b656bb8dd0741 Binary files /dev/null and b/plots/treeplot.png differ diff --git a/plots/treeplot.py b/plots/treeplot.py new file mode 100644 index 0000000000000000000000000000000000000000..c5ec2c074e0b1fead9da2aa92cae5537b09804a3 --- /dev/null +++ b/plots/treeplot.py @@ -0,0 +1,23 @@ +import numpy as np +import matplotlib.pyplot as plt +from matplotlib.patches import Rectangle + +tree = np.loadtxt("../out/tree.txt") +pos = np.loadtxt("../data/data.txt") + +x = pos[:,2] +y = pos[:,3] + +fig, ax = plt.subplots() + +# ax.scatter(tree[:,0], tree[:,1], color='r', s=0.1) +ax.scatter(x, y, color='b', s=0.1) + +for i in range(tree.shape[0]): + size = tree[i,3] + ax.add_patch(Rectangle((tree[i,0] - size, tree[i,1] - size), 2*size, 2*size, linewidth=1, edgecolor='k', facecolor='none', alpha=0.5)) + # ax.text(tree[i,0], tree[i,1], str(tree[i,4]), fontsize=8, horizontalalignment='center', verticalalignment='center') + ax.set_aspect('equal') + +plt.savefig("treeplot.png") +plt.show() \ No newline at end of file