Home > Software design >  Cufflink plot changing the axis scale
Cufflink plot changing the axis scale

Time:09-27

I am plotting a pivot chart using cufflinks.Code is given below.

df_thd_funct_dbspl = pd.read_csv("THD_M2.txt",delim_whitespace=True)
check_for_nan = df_thd_funct_dbspl.isnull().values.any()
print (check_for_nan)
df_thd_funct_dbspl.head()
Head_Values_dB = list(df_thd_funct_dbspl.columns.values)
Head_Values_minus_First_Column_dB = Head_Values_dB[3:]

THD_Mode1_Funct_PVT = pd.pivot_table(df_thd_funct_dbspl, index = ['IN_dB_SPL'],values = Head_Values_minus_First_Column_dB)
THD_Mode1_Funct_PVT['SPEC MAX'] = 10
THD_Mode1_Funct_PVT.iplot()

My plot is given below.You can see that X axis starts from 95 then 100 105 and so on with a difference of 5.

I need the axis to be 95,96,..with a difference of 1.May I know how to approach this.

enter image description here

CodePudding user response:

You can change the step size of the x-axis by dtick:

table.iplot(layout={"xaxis":{"dtick":1}})
  • Related