Skip to content

Instantly share code, notes, and snippets.

@rcalsaverini
Created March 22, 2013 16:56
Show Gist options
  • Save rcalsaverini/5222929 to your computer and use it in GitHub Desktop.
Save rcalsaverini/5222929 to your computer and use it in GitHub Desktop.
Contourplot with matplotlib
import pandas
import datetime
from pylab import *
data = pandas.read_csv('file.csv', index_col = 0, header = 0, sep = '\t')
timesIndex = data.index
dynamapsIndex = data.columns
levels = map(lambda x : round(x,1), linspace(data.min().min(), data.max().max(), 101))
contourf(data, levels = levels, cmap=plt.cm.jet_r, interpolation = 'bicubic')
colorbar()
xticks(range(0, len(dynamapsIndex),5), dynamapsIndex[::5], rotation = 'vertical')
yticks(range(0, len(timesIndex), 5), timesIndex[::5])
show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment