Add hue_kws and markers to axis grids #323

Merged
merged 4 commits into from Oct 5, 2014

Conversation

Projects
None yet
2 participants
@mwaskom
Owner

mwaskom commented Oct 5, 2014

This lets the user map the hue variable with arbitrary additional plot
aesthetics in FacetGrid/PairPlot, and it provides an easy interface to map the
scatterplot marker when using lmplot/pairplot.

sns.lmplot("total_bill", "tip", tips, hue="smoker", markers=["x", "o"], scatter_kws={"s": 50})

markers

g = sns.FacetGrid(attention, col="subject", col_wrap=5, hue="attention", 
                             hue_kws={"marker": ["s", "D"], "linestyle": ["-", "--"],},
                             aspect=.75)
g.map(plt.plot, "solutions", "score", ms=10, lw=3)
g.set(xlim=(.5, 3.5), xticks=[1, 2, 3], ylim=[0, 10])

facetgrid

sns.pairplot(iris, "species", markers=["o", "D", "s"], size=2)

pairgrid

This also has a small enhancement to change the marker params depending on the
kind of marker so that line-based glyphs are not invisible (which would
otherwise be the case with the default seaborn rc Params). This is only in lmplot, pending the introduction of sns.scatterplot.

Closes #310

Add hue_kws to FacetGrid and markers to lmplot
This lets the user map the hue variable with arbitrary additional plot
aesthetics in FacetGrid, and it provides an easy interface to map the
scatterplot marker when using lmplot.

This also has a small enhancement to change the marker params depending on the
kind of marker so that line-based glyphs are not invisible (which would
otherwise be the case with the default seaborn rc Params)

@mwaskom mwaskom changed the title from Add hue_kws to FacetGrid and markers to lmplot to Add hue_kws and markers to axis grids Oct 5, 2014

mwaskom added a commit that referenced this pull request Oct 5, 2014

Merge pull request #323 from mwaskom/lmplot_markerstyle
Add hue_kws and markers to axis grids

@mwaskom mwaskom merged commit 9cb1263 into master Oct 5, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@shoyer

This comment has been minimized.

Show comment
Hide comment
@shoyer

shoyer Oct 5, 2014

Contributor

Looks great!

This should let you do custom linestyles, too, yes? For example, if I wanted the second set of lines in the second example to be dashed, I could write something like hue_kws={'linestyle': ['-', '--']}?

Contributor

shoyer commented Oct 5, 2014

Looks great!

This should let you do custom linestyles, too, yes? For example, if I wanted the second set of lines in the second example to be dashed, I could write something like hue_kws={'linestyle': ['-', '--']}?

@mwaskom

This comment has been minimized.

Show comment
Hide comment
@mwaskom

mwaskom Oct 5, 2014

Owner

Yep! I just edited the example plot to show that. With the FacetGrid interface any kwarg for the function you want to map can be in the hue_kws.

Owner

mwaskom commented Oct 5, 2014

Yep! I just edited the example plot to show that. With the FacetGrid interface any kwarg for the function you want to map can be in the hue_kws.

@mwaskom mwaskom deleted the lmplot_markerstyle branch Oct 21, 2014

@pyup-bot pyup-bot referenced this pull request in mayou36/raredecay May 18, 2017

Closed

Pin seaborn to latest version 0.7.1 #10

@pyup-bot pyup-bot referenced this pull request in tnir/pandas Feb 2, 2018

Open

Pin seaborn to latest version 0.8.1 #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment