This is my first matplotlib program, so sorry for my ignorance.
I've two arrays of string. say, A = ['test1','test2']
and B = ['test3','test4']
.
If any correlation exists between A
and B
element, their corr value will be set to 1
.
test1 | test2
test3 | 1 | 0
test4 | 0 | 1
Now, I want to draw a scatter diagram where my X axis will be elements of A
, Y axis will be elements of B
and if correlation value is 1
, it'll be marked in the scattered plot. how to do that?
Maybe something like this:
EDIT:
Let me see if I understand you correctly now:
You have:
Now you want to represent the above values in in a scatter plot, such that value of 1 is represented by a dot.
Let's say you results are stored in a 2-D list:
We want to transform them into two variables so we are able to plot them.
And I believe this code will give you what you are looking for:
Notice that I do need to import
pylab
, and you would have play around with the axis labels. Also this feels like a work around, and there might be (probably is) a direct method to do this.