Last active
December 12, 2016 21:28
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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