0 votes
1 view
in Data Science by (17.6k points)

By default the seaborn displaces the X axis ranges from -5 to 35 in distplots. But I need to display the distplots with the X axis ranges from 1 to 30 with 1 unit. How can I do that?

1 Answer

0 votes
by (38.2k points)

You can use below code to accomplish your task:

import matplotlib.pyplot as plt

import seaborn as sns

tips = sns.load_dataset("tips")

sns.set_style("whitegrid")

g = sns.lmplot(x="tip", y="total_bill", data=tips,

 aspect=2)

g = (g.set_axis_labels("Tip","Total bill(USD)").

set(xlim=(0,15),ylim=(0,100)))

plt.title("title")

plt.show(g)

If you face any further issues, then you can go through this article on python for reference.

Related questions

0 votes
1 answer
asked Apr 26 in Data Science by blackindya (11.1k points)
0 votes
1 answer
asked Apr 25 in Data Science by blackindya (11.1k points)
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...