79709404

Date: 2025-07-21 17:04:07
Score: 1
Natty:
Report link

I ended up using tricontourf which seems to work ok.

using CairoMakie
samplebjs = [[cos(pi/3), sin(pi/3) ], [cos(2*pi/3), sin(2*pi/3)] ]
testN=100
sampleLattice = [ [i,j] for i in 1:testN, j in 1:testN   ]

sampleLattice = [ sampleLattice[j] for j in 1:length(sampleLattice)  ]

xs = [ 1/testN*sum(v.*samplebjs)[1] for v in sampleLattice          ]
ys = [ 1/testN*sum(v.*samplebjs)[2] for v in sampleLattice          ]

zs = [ 1 for v in sampleLattice]
f, ax, tr = tricontourf(xs, ys, zs)

scatter!(xs, ys, color = zs)

Colorbar(f[1, 2], tr)

display(f)

Which gives:

enter image description here

As desired (colorbar wonky, because z=1 everywhere. Seems to work ok when that is not the case)

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Mstislav Keldysh