question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sns.lmplot doesn't handle ax keyword correctly

See original GitHub issue
import pandas as pd

import pylab as plt
import seaborn as sns
print sns.__version__   # 0.5.1

df = pd.DataFrame({"A":[1,2,3],
                   "B":[4,5,7]})
fig, ax = plt.subplots(1,1)
sns.lmplot("A","B",df,ax=ax)
#sns.regplot("A","B",df,ax=ax) # regplot works as intended
plt.show()

The output with version 0.5.1 looks like:

screenshot from 2014-12-21 15 12 12

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

21reactions
ferreiraleocommented, Feb 10, 2018

How can I plot any seaborn scatter plot that supports subplots and hue???

10reactions
mwaskomcommented, Feb 24, 2018

@gibsondanield read the rest of the sentence:

Understanding the difference between regplot() and lmplot() can be a bit tricky. In fact, they are closely related, as lmplot() uses regplot() internally and takes most of its parameters. However, regplot() is an axes-level function, so it draws directly onto an axes (either the currently active axes or the one provided by the ax parameter), while lmplot() is a figure-level function and creates its own figure, which is managed through a FacetGrid.

Read more comments on GitHub >

github_iconTop Results From Across the Web

seaborn: lmplot() got an unexpected keyword argument 'figsize'
Since an lmplot is "figure-level", figsize is determined by two parameters, size and aspect . I think size=7 will do what you want...
Read more >
seaborn.lmplot — seaborn 0.12.1 documentation - PyData |
This can be helpful when plotting variables that take discrete values. {scatter,line}_kwsdictionaries. Additional keyword arguments to pass to plt.scatter and ...
Read more >
Python – How to add title on seaborn lmplot – iTecNote
I am trying to add title on Searbon lmplot. ax = plt.axes() sns.lmplot(x, y, data=df, hue="hue", ax=ax) ax.set_title("Graph (a)") plt.show().
Read more >
Building structured multi-plot grids — seaborn 0.9.0 ...
Some seaborn functions (such as lmplot() , catplot() , and pairplot() ) ... are lists of keyword values, one for each level of...
Read more >
Complete Seaborn Python Tutorial for Data Visualization in ...
Now we will draw a plot for the data of type I from the dataset. scatter_kws is used to pass additional keyword arguments....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found