The adapted code for arbitrary guiding vectors and with pixel shape correction:
import GLMakie as mak
# Data to plot:
xmin, xmax, Nx = -3, 3, 100
ymin, ymax, Ny = -3, 3, 200
x = range(xmin, xmax, length=Nx)
y = range(ymin, ymax, length=Ny)
img = @. exp(-(x * y')^2)
# Axes guiding vectors:
# a1, a2 = mak.Point2f(1,0), mak.Point2f(0,1)
# a1, a2 = mak.Point2f(2,1), mak.Point2f(1,2)
a1, a2 = mak.Point2f(1,-0.5), mak.Point2f(-0.5,1)
# normalize axes vectors:
a1 = a1 / sqrt(sum(abs2, a1))
a2 = a2 / sqrt(sum(abs2, a2))
# Define pixel:
dx = step(x)
dy = step(y)
dp = mak.Point2f(sqrt(dx*dy), sqrt(dx*dy))
# pixel = mak.Point2f[(0,0), (dp[1],0), (dp[1],dp[2]), (0,dp[2])] # square pixel
pixel = [mak.Point2f(0,0), dp*a1, dp*(a1+a2), dp*a2] # skew pixel
# Compute all pixel positions:
pixels = [
pixel .+ ((i-1) * dp[1] * a1 + (j-1) * dp[2] * a2) for j=1:Ny for i=1:Nx
]
# Figure and axis:
fig = mak.Figure()
ax = mak.Axis(fig[1,1])
mak.hidedecorations!(ax)
# draw new axes:
xlen = 1.1 * (dp[1] * Nx)
ylen = 1.1 * (dp[2] * Ny)
O = mak.Point2f(0,0)
mak.lines!(ax, [O, O + xlen*a1]; color=:black)
mak.lines!(ax, [O, O + ylen*a2]; color=:black)
mak.text!(ax, mak.L"a_1"; position=O+xlen*a1, color=:black)
mak.text!(ax, mak.L"a_2"; position=O+ylen*a2, color=:black)
# draw the resulting heatmap:
mak.poly!(ax, pixels, color=vec(img))
fig