Skip to content
Open
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.ipynb_checkpoints

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# snippets
Scripts, settings and environment options for better research and analysis

## tri_heatmap: Heatmaps in matplotlib
This directory includes a notebook that gives some guidance on plotting 2D
heatmaps in matplotlib given the existence of X, Y, Z experimental data. Note
this was developed for and is thus ideal for an irregular X-Y grid.
13 changes: 13 additions & 0 deletions tri_heatmap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Heatmaps in matplotlib
Given X, Y, Z experimental data suited to heatmap plotting, one can follow the
steps in this notebook to get a surface plot with a colorbar. This notebook
shows three varieties of surface plots using toy data.

For all plots, it first uses triangulation on the X, Y data to form a
triangular grid (and normalizes the colors to the z range). There are three
methods used to plot the surface:
1. tricontourf
2. tripcolor with flat shading
3. tripcolor with Gourard shading

Note that the color bar is only smoothed with tripcolor.
284 changes: 284 additions & 0 deletions tri_heatmap/heatmap.ipynb

Large diffs are not rendered by default.