Questions tagged [lmplot]
31 questions
0
votes
0 answers
I am looking to have two Seaborn lmplots side by side with each one maintaining the titles above
I saw several answers regarding subplots but I am unsure how to set it up using my code. I have two functions that give me two lmplots from Seaborn and I would like to get the figure shown below. How can I make the two lmplots look like the other…
0
votes
1 answer
Is it possible to add multiple smoothed order lines in the same lmplot?
I would like to show multiple smoothed order lines in the same graph using lmplot from seaborn. For example I would like to show an smoothed order line of 1 and 5 colored in the same graph. Here are two example graphs I would like to have combined…

Quinten
- 35,235
- 5
- 20
- 53
0
votes
1 answer
TypeError when adding regression line per group with seaborn in python
I've been having issues with plotting a regression line for two groups using seaborn.
Here is a test df:
data = [['2020-06-01', '521732A', 1, 195.0, 0.0],
['2020-06-02', '521732A', 34, 250.0, 0.01],
['2020-06-03', '521732A', 55, 180.0,…

Charlie
- 11
0
votes
1 answer
seaborn lmplot logistic raises AttributeError: module 'pandas' has no attribute 'Panel'
I am using the code below that I took from the Seaborn documentation as it is. Running this code results in an error.
AttributeError: module 'pandas' has no attribute 'Panel'
I am wondering if there is a way around this problem without reverting to…

Ozan.kah
- 91
- 8
0
votes
0 answers
Is there a way to set the hue class in a seaborn regression plot?
I have a dataset composed of four columns, as follows:
Ice Core
nssSO4
Cl
Na
IC-02
31.71
413.68
32.75
And so on...
There are 5 different Ice Core categories and I made graphics correlating the Na with the Cl using the lmplot from the…
0
votes
0 answers
Annotations for lmplot/FacetGrid subplots show up wrong - how to loop through Axes to set annotations correctly?
I made some regression plots with FacetGrid/lmplot and would like to add regression coefficients, p values etc. to each subplot. However the annotations show up in weird places (s. picture) and I don't exactly understand how to work with the axes…

RBG
- 69
- 1
- 5
0
votes
1 answer
How to write the conditional branches for R lattice package
I use lattice package to draw the picture using the below csv file.
csv file
I used the below code and got the expected picture.
library(lattice)
data_1 <- read.table("./stackoverflow.csv", header=T, sep=",")
data <- na.omit(data_1)
xyplot(a ~ b |…

rrkk
- 437
- 1
- 5
- 15
0
votes
1 answer
Seabron lmplot add Rsquarred annotation with scipy
I want to add annoation of Rsquarred value when I stumble upon the solution for pearson r correlation using scipy
import pandas as pd
import numpy as np
import seaborn as sns
import scipy as sp
import matplotlib.pyplot as plt
from scipy.stats import…

choco
- 73
- 7
0
votes
1 answer
How to avoid regression line truncation in zoomed-out lmplot?
I experience 2 problems with this plot:
I tried to add in other features to my code, however the regression lines remain truncated in the lmplot().
When I add the settings for the legend, another legend is added at the bottom left. However, the…

Rouche Zaaiman
- 1
- 2
0
votes
1 answer
Why the point size using sns.lmplot is different when I used plt.scatter?
I want to do a scatterplot according x and y variables, and the points size depend of a numeric variable and the color of every point depend of a categorical variable.
First, I was trying this with plt.scatter:
Graph 1
After, I tried this using…

Alex Amaguaya
- 21
- 4
0
votes
1 answer
Seaborn: How to specify plot minor ticks and gridlines in all plots when using lmplot?
I'm trying to get minor ticks and gridlines plotted in all plots when using lmplot, using the code below:
sns.set(context="notebook", style='white', font_scale=2)
g=sns.lmplot(data=data ,
x="x",
y="y",
…

Pablo
- 167
- 2
- 9
0
votes
2 answers
Change each regression line styling using in a multiple regressions plot Python
I am currently trying to plot two regression lines for my data split by a categorical attribute (which is either freedom or happiness scores). My current qualm is that I need color to encode another separate categorical attribute in my graph…

allquiet1984
- 25
- 5
0
votes
0 answers
Seaborn: how to change a logarithmic axis format from scientific to plain and display ticks in all subplots (Facetgrid)
I'm using the following code to produce a lmplot. The output is 6 different plots (controlled by the hue parameter).
g=sns.lmplot(data=fenix,
x='x',
y='y',
hue='var',
col="var",
…

Pablo
- 167
- 2
- 9
0
votes
1 answer
How to plot seaborn lmplots in multiple subplots
I was trying to plot multiple lmplots in the same figure. But I am getting too many unwanted subplots.
I found another SO link How to plot 2 seaborn lmplots side-by-side? but that also did not help me.
In this example I want 1 row 2 columns.
MWE
#…

BhishanPoudel
- 15,974
- 21
- 108
- 169
-1
votes
1 answer
Seaborn after dates.num2date(x) not showing X equals (x=y=7.51) on the graph, lmplot
After converting dates to floats (necessary to use dates in lmplot) then, when trying to set
ax.set_xticklabels the X disappears on the graph in the lower right corner, eg. (x=y=7.51).
import pandas as pd
import matplotlib.pyplot as plt
from…

Robb
- 45
- 1
- 5