Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am teechap on github.
  • I am tc (https://keybase.io/tc) on keybase.
  • I have a public key ASA1MoRnkLQLFbmdTiqDbrKILEe6gtBgSdkaPpP2rAHCmAo

To claim this, I am signing this object:

@teechap
teechap / heatmap_with_masking.py
Created October 23, 2014 22:27
Heatmap with masked data using pyplot.pcolormesh and numpy
'''
Makes a heatmap in which np.nan types in the intensity array aren't plotted.
'''
import matplotlib.pyplot as plt
import numpy as np
#here's our data to plot, all normal Python lists
x = [1, 2, 3, 4, 5, 6, 7]
y = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7]

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@teechap
teechap / client.go
Last active August 29, 2015 14:07 — forked from cryptix/client.go
package main
import (
"io"
"log"
"mime/multipart"
"net/http"
"os"
"path/filepath"
"runtime"
@teechap
teechap / heatmap_example.py
Created September 18, 2014 00:35
How to make a heatmap from data stored in Python lists
'''
Most heatmap tutorials I found online use pyplot.pcolormesh with random sets of
data from Numpy; I just needed to plot x, y, z values stored in lists--without
all the Numpy mumbo jumbo. Here I have code to plot intensity on a 2D array, and
I only use Numpy where I need to (pcolormesh expects Numpy arrays as inputs).
'''
import matplotlib.pyplot as plt
import numpy as np
#here's our data to plot, all normal Python lists