Skip to content
Advertisement

python seaborn plotting using index when index has some missing values

I have a dataframe as below. Index is blank for some rows. I want to plot it and my code is as below

  1. i am struggling with marker It is appearing only for few points – how could i show all the points?
  2. How could I rotate x axis labels. I tried the last line that i have commented.

lst = [5,10,8,7,8,4,6,8,9]

df = pd.DataFrame(lst, index =['a', '', '', 'd', '', '', '','e','f'], columns =['Names'])

df

enter image description here

JavaScript

enter image description here

Advertisement

Answer

You could use a dummy np.arange for the x-axis, and then relabel the x-axis.

JavaScript

sns.lineplot with dummy x-axis

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement