04 May 2015
  1. implot - anscombe’s quartet

  2. barplot - color palette choices

  3. kdeplot

  4. distplot

  5. violinplot

  6. FacedGrid

  7. FacedGrid

  8. factorplot

  9. factorplot

  10. heatmap

  11. jointplot

  12. interactplot

  13. jointplot

  14. Implot

  15. FacedGrid

  16. corrplot

  17. JointPlot

  18. Implot

  19. heatmap

  20. PairGrid

  21. PairGrid

  22. factorplot

  23. jointplot

  24. residplot

  25. pairplot

  26. violinplot

  27. clustermap

  28. tsplot

  29. tsplot

  30. factorplot

import

        import seaborn as sns
        %matplotlib inline
        import numpy as np
        import matplotlib.pyplot as plt

1. implot - anscombe’s quartet

        sns.set(style='ticks')
        df = sns.load_dataset('anscombe')
        sns.lmplot('x', 'y', col='dataset', hue='dataset',
                   data=df, col_wrap=2, ci=None, palette='muted',
                   size=4, scatter_kws={'s': 50, 'alpha': 1})

2. barplot - color palette choices

        sns.set(style='white', context='talk')
        rs = np.random.RandomState(7)

        x = np.array(list('ABCDEFGHI'))

        f, (ax1, ax2, ax3) = plt.subplots(3, 1, figsize=(8, 6), sharex=True)

        y1 = np.arange(1, 10)
        # array([1, 2, 3, 4, 5, 6, 7, 8, 9])
        sns.barplot(x, y1, ci=None, palette='BuGn_d', hline=1, ax=ax1)
        ax1.set_ylabel('Sequential')

        y2 = y1 - 5
        # array([-4, -3, -2, -1,  0,  1,  2,  3,  4])
        sns.barplot(x, y2, ci=None, palette='coolwarm', hline=0, ax=ax2)
        ax2.set_ylabel('Diverging')

        y3 = rs.choice(y1, 9, replace=False)
        # array([3, 8, 1, 9, 6, 4, 7, 2, 5])
        sns.barplot(x, y3, ci=None, palette='Paired', hline=.1, ax=ax3)
        ax3.set_ylabel('Qualitative')

        sns.despine(bottom=True)
        plt.setp(f.axes, yticks=[])
        plt.tight_layout(h_pad=3)


blog comments powered by Disqus