why line chart is starting from size=2 and not size=1 like the bar chart?
import matplotlib.pyplot as plt
import pandas as pd
data = {
'size': [1, 2, 3, 4, 5, 6],
'Yes': [1100.65, 1185.08, 338.30, 336.70, 58.61, 0.00],
'No': [1700.32, 1380.81, 546.25, 722.00, 91.73, 139.32]
}
df = pd.DataFrame(data).set_index('size')
print(df)
# Plot data
fig, ax = plt.subplots(figsize=(10, 6))
# Plot stacked bar chart on primary axis
df.plot(kind='bar', stacked=True, ax=ax, legend=False)
# Plot line chart on primary axis (same as bar chart)
df.plot(kind='line', ax=ax, legend=False)
plt.show()