Created
July 16, 2015 15:28
-
-
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
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
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