In [1]:
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
%load_ext watermark
%watermark --python --iversions


pandas     0.24.0
matplotlib 3.0.2
CPython 3.6.8
IPython 7.2.0

In [2]:
actions = []
results = []
for i in range(1,6):
    action = 'action-' + str(i)
    result = i
    actions.append(action)
    results.append(i)
       
df = pd.DataFrame(data = zip(actions, results), columns = ['Action_Label','Result'])
df.insert(0, 'Action_Id', range(len(actions)))
df


Out[2]:
Action_Id Action_Label Result
0 0 action-1 1
1 1 action-2 2
2 2 action-3 3
3 3 action-4 4
4 4 action-5 5

In [3]:
ax1 = df.plot.scatter(x='Action_Id', y='Result')



In [4]:
# same table
ax2 = df.plot.scatter(x='Action_Id', y='Result')

# but use action ids as ticks
_ = ax2.set_xticks(df.Action_Id)

# and use action labels as labels for ticks
_ = ax2.set_xticklabels(df.Action_Label, rotation=45)

# beware that '_' is important to "absorb" matplotlib verbose messages
# that would otherwise be displayed in the standard output (ie: screen)
#
# instead, a ';' at the end of the line may sometimes work, but not systematically



In [ ]: