I'm using matplotlib.
I managed to plot a 2D array of hexagons using plt.scatter, where I set the marker to 'h' for hexagon and set the size to something big like s=500 or so. Through simple math I made arrays for the position of each hexagon (normalized the pitch to 1). Here's my picture of the hexagons which plotted as expected.
However, I want to plot triangles (6 equal ones) within those hexagons and it's not as easy. Here's part of the code I used to plot the triangles:
fig4, ax4 = plt.subplots()
ax4.set_aspect('equal')
for i in range(len(powtri)):
for j in range(len(powtri[i])):
plt.scatter(x=X_tric[i][j], y=Y_tric[i][j], s=size, marker=markers[i][j], c=powtri[i][j], cmap='jet')
cbar3 = plt.colorbar(fraction=0.03, pad=0.04)
cbar3.set_label('Normalized assembly power')
plt.axis('off')
plt.title('Triangle Powers')
My options are using the markers 4&5 or <&> (which I used in the markers array to alternate left/right triangles) and then I calculated the centers of each triangle (or position of pointy end for each triangle), but the actual problem is that my picture keeps getting cut off with ugly formatting and the sizes and position of of the triangle markers keep changing so I end up with this.
Am I approaching this the wrong way?
Thanks.