Skip to content

Instantly share code, notes, and snippets.

@Alexander-Barth
Last active December 12, 2016 21:28
Show Gist options
  • Save Alexander-Barth/bb7368f86e9200b7a2a2fb28ede74870 to your computer and use it in GitHub Desktop.
Save Alexander-Barth/bb7368f86e9200b7a2a2fb28ede74870 to your computer and use it in GitHub Desktop.
Simple example how to make a pcolor plot with missing values (equal to NaN) in Julia
# pcolor plot with missing values (equal to NaN) in Julia
using PyCall
@pyimport numpy.ma as ma
# some random data
A = randn(10,10);
A[2,2] = NaN;
# created a Masked Array
# see also
# http://stackoverflow.com/questions/35709042/how-to-create-a-masked-array-using-numpy-ma-imported-by-pycall-in-julia/35710432
x = pycall(ma.array, Any, A, mask=isnan(A))
pcolor(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment