When I add c
to a pandas plot, x tick labels disappear. Does anyone know how to add them back?
import pandas as pd
df = pd.DataFrame(
{'mean': {0: 10,
1: 16,
2: 18,
3: 22,
4: 30},
'size': {0: 103, 1: 2509, 2: 41939, 3: 145997, 4: 143530},
'value': {0: 1.5, 1: 4.5, 2: 7.5, 3: 10.5, 4: 13.5}}
)
ax = df.plot(kind='scatter', x='value', y='mean', s=60, c='size', cmap='RdYlGn')
Tried to manually add x tick labels, but still not working.
ax.set_xticks(df['value'])
ax.set_xticklabels(df['value'])