0

This code should give the x-axis labels, however it doesn't.

I'm running the code in jupyter with the following code:

df = pd.DataFrame({
'Precision': [0.0983, 0.2936, 0.3992, 0.4016, 0.1360],
'Recall': [0.8495, 0.3312, 0.3065, 0.0995, 0.1071],
'F1': [0.1763, 0.3113, 0.3467, 0.1595, 0.1198]
}, index=['EDbase', 'ED + i1', 'ED +i2', 'ED +i3', 'ED +i4'])
lines = df.plot.line()

Why doesn't it display the x-axis labels and how do I remedy this issue?

Image
plt

meW
  • 3,832
  • 7
  • 27
Eeuwigestudent1
  • 161
  • 1
  • 2
  • 13

1 Answers1

3

There you go champ -

df = pd.DataFrame({
'Precision': [0.0983, 0.2936, 0.3992, 0.4016, 0.1360],
'Recall': [0.8495, 0.3312, 0.3065, 0.0995, 0.1071],
'F1': [0.1763, 0.3113, 0.3467, 0.1595, 0.1198]
}, index=['EDbase', 'ED + i1', 'ED +i2', 'ED +i3', 'ED +i4'])
lines = df.plot.line()

# Something to remember
plt.xticks(np.arange(5), df.index)
plt.show()

plt

meW
  • 3,832
  • 7
  • 27