Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pairplot yaxis diagonal

import numpy as np
import seaborn as sns
import pandas as pd

def my_hist(x, label, color):
    ax0 = plt.gca()
    ax = ax0.twinx()
    
    sns.despine(ax=ax, left=True, top=True, right=False)
    ax.yaxis.tick_right()
    ax.set_ylabel('Counts')
    
    ax.hist(x, label=label, color=color)

data = np.random.normal(0,2,[1000,3])
df = pd.DataFrame(data)

g = sns.PairGrid(df,corner=True)
g.map_diag(my_hist)
g.map_lower(sns.scatterplot)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pairplot #yaxis #diagonal
ADD COMMENT
Topic
Name
3+2 =