plotting n grid like structure

import seaborn as sns

appended_data= pd.DataFrame({'Ethnicity':[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
           1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
           2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
           3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
    'Count': [1, 5, 8, 5, 4, 9, 4, 3, 2, 1, 1, 2, 1, 1, 1, 1, 1, 5, 6, 9, 2, 5,
           2, 1, 1, 3, 2, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 3, 2, 8, 1, 1, 2,
           6, 1, 2, 7, 1, 3, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 8, 2, 8, 4, 5, 1,
           3, 2, 3, 2, 1, 1, 2, 3, 1, 1, 2, 1], 
    'Locus':['13,12', '11,12', '10,10', '12,11', '12,12', '10,12', '10,11',
               '12,10', '11,11', '11,7', '11,13', '11,10', '12,7', '12,13',
               '13,10', '10,8', '9,10', '11,11', '12,11', '10,12', '13,13',
               '12,12', '11,13', '10,13', '12,13', '11,10', '11,12', '12,10',
               '9,12', '10,10', '9,11', '13,10', '7,12', '7,10', '9,10', '10,11',
               '13,8', '11,7', '10,11', '7,12', '10,10', '13,10', '12,7', '11,12',
               '11,11', '11,7', '11,10', '10,12', '9,12', '12,11', '12,8', '8,10',
               '12,12', '12,9', '13,11', '14,10', '7,11', '8,12', '10,7', '10,8',
               '12,12', '13,11', '10,11', '11,10', '11,12', '8,11', '12,10',
               '13,10', '13,12', '12,11', '11,11', '12,7', '10,10', '10,13',
               '11,14', '11,7', '10,12', '12,9']})

g = sns.FacetGrid(appended_data, col="Ethnicity", col_wrap=2)
g.map(sns.scatterplot, "Locus", "Count")

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top