Skip to content

Commit 68ea52c

Browse files
committed
match mrcal
1 parent d48a6f6 commit 68ea52c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

heatmap-gen.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111
plt.figure()
1212
plt.title("Projection Uncertainty (in pixels), looking out to infinity")
1313

14-
sc = plt.scatter(x, y, c=z)
15-
plt.colorbar(sc, label="z")
16-
17-
# force heat range to go from 0 to 10
18-
plt.clim(0, 10)
14+
# Create contour plot with 1px increments
15+
levels = np.arange(0, 11, 1) # 0, 1, 2, ..., 10
16+
contour = plt.tricontour(x, y, z, levels=levels, colors='black', linewidths=0.5)
17+
contourf = plt.tricontourf(x, y, z, levels=levels, cmap='viridis')
18+
plt.clabel(contour, inline=True, fontsize=8, fmt='%1.0f px')
19+
plt.colorbar(contourf, label="Uncertainty (px)")
1920

2021
plt.xlabel("x")
2122
plt.ylabel("y")
23+
plt.gca().invert_yaxis()
2224
plt.axis("equal")
2325
plt.tight_layout()
2426

0 commit comments

Comments
 (0)