Python Forum
How to prevent tick labels overlapping with axis
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to prevent tick labels overlapping with axis
#1
I want to see correlation between variables, but when I plot using scatter plot, the variable labels are overlapping with axis, may some one kindly help, how to create space between tick labels and axis

    import pandas as pd
    import numpy as np
    import matplotlib.pyplot as plt
    from scipy import stats
    dataFileName='Input.xlsx'
    sheetName='Data'
    dataRaw=pd.read_excel(dataFileName,sheetname=sheetName)
    noData=len(dataRaw)
    import matplotlib.pylab as plt
    from sklearn.cross_validation import train_test_split
    from sklearn.cross_validation import cross_val_score
    from sklearn.preprocessing import StandardScaler
    import pandas as pd
    import numpy as np

    labels=['GasFlow','Pressureset','Temperature']
    x=dataRaw[labels]
    sm=pd.tools.plotting.scatter_matrix(x,alpha=0.2,figsize=(10,10),c='red',hist_kwds={'color':[burlywood']})
    [s.xaxis.label.set_rotaion(90) for s in sm.reshape(-1)]
    [s.yaxis.label.set_rotaion(0) for s in sm.reshape(-1)]


Here, the y-axis labels are overlapping with axis, 

my input data for first three variables:

My data is below:
GasFlow   Pressureset  Temperature
1.2       1.6          3.2
1.2       1.6          3.2
2.6       1.9          6.5 
1.2       1.6          3.2
2.6       1.9          6.5
1.2       1.6          3.2
1.2       1.6          3.2
2.6       1.9          6.5
1.2       1.6          3.2
Reply


Messages In This Thread
How to prevent tick labels overlapping with axis - by SriRajesh - May-12-2018, 07:24 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Dataframe.hist() labels overlapping graphs RawlinsCross 2 4,722 Jan-14-2020, 03:02 PM
Last Post: RawlinsCross
  How matplotlib automatically set x-axis and y-axis limits for bar graph ? ift38375 3 5,669 Jul-04-2019, 08:23 AM
Last Post: scidam
  Add tick labels in healpy.mollview ? BourbonKid67 4 4,988 Apr-10-2019, 10:19 AM
Last Post: BourbonKid67

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020