0

enter image description here

my image is too dense like above. I would like to increase xticks range(ig, 0.1 0.2 0.3 0.4). Please let me know how.

facet = sns.lmplot(data = df, x='x', y='y', hue='label', fit_reg=False, legend = True)
Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Ken Kim
  • 149
  • 2
  • 9

1 Answers1

4

Change the figure size with the height and aspect properties. Use ax.set_xticks to set the desired x-axis tick limits and frequency. The same can be done for the y-axis by using ax.set_yticks.

import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

np.random.seed(365)  # only for repeatability of the sample data
df = pd.DataFrame(np.random.randint(0,high=100,size=(1000,2)),columns=['x','y'])
facet  = sns.lmplot(x='x',y='y',data=df,height=6, aspect=2)
facet.ax.set_xticks(np.arange(0, 101, 5))
plt.show()

enter image description here

  • With facet.ax.set_xticks(np.arange(0, 101, 10))

enter image description here

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Space Impact
  • 13,085
  • 23
  • 48