Skip to content

Instantly share code, notes, and snippets.

@mbeltagy
Created July 16, 2015 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbeltagy/834988ba7b4c0eb69922 to your computer and use it in GitHub Desktop.
Save mbeltagy/834988ba7b4c0eb69922 to your computer and use it in GitHub Desktop.
A pairs function in julia that uses PyPlot to generate plots similar to R's pairs
function pairs(d::DataFrame)
varnames= map(string,names(d))
l=length(varnames)
count=0
for i=1:l
for j=1:l
count+=1
ax=subplot(l,l,count)
ax[:xaxis][:set_visible](false)
ax[:yaxis][:set_visible](false)
if i==j
text(0.5, 0.5,varnames[i],ha="center", va="center")
else
subplot(l,l,count)
plot(d[:,j],d[:,i],"+")
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment