Reputation: 19
I have two data sets:
From these two data sets, I have created two factor plots
sns.factorplot(x='state', y='deaths', data=death, aspect = 4)
plt.xticks(rotation=90)
smoking['total_smoker'] = smoking['smoke_everyday'] + smoking['smoke_some_days']
sns.factorplot(x='state', y='total_smoker', data=smoking.sort_values("state"), aspect = 3)
plt.xticks(rotation = 90)
I am looking for a way to visually compare the two lines. Is there a way to create one factor plot using data from both sets in order to better compare data per state? Is there maybe a better way to show this visualization than what I am thinking? Apologies if my question is unclear, my experience with these tools are still lacking.
Upvotes: 0
Views: 1185
Reputation: 40737
just use two lineplot
on the same axes:
fig, ax = plt.subplots()
sns.lineplot(..., ax=ax) # first dataset
sns.lineplot(..., ax=ax) # second dataset
Upvotes: 1