I'm trying to overlay a stacked bar with a line plot. Running off pandas 0.25.3 working in vscode jupyter notebook. I have plotted this numerous times with different data sets using the relatively standard way below - but in this case I only get the latter matplot object plotted
fig, ax = plt.subplots()
ax2=ax.twinx()
df1.plot(kind='bar',stacked=True, ax=ax)
df2.plot(ax=ax2,linestyle='-', marker='o')
df1 and df2 by design have the same index. I have also tried merging these in case that was the driving issue as well as combinations using secondary_y, setting ax2 object to the matplot object. I tried the below work around too and tried simplifying to a bar chart on the primary axis. Secondary and primary line graphs plot fine too, so no issue with the underlying data (nan free etc)
pandas DataFrame how to mix bar and line plots with different scales
Data is the form as below (when joined) - where col3 is the line plot, col1 and col2 are the stacked bars
idx col1 col2 col3
1.0 0.2 0.8 0.6
2.0 0.1 0.9 0.52
3.0 0.1 0.9 0.5
4.0 0.05 0.95 0.43
There are numerous questions asking similar on this site, but they tend to be more for beginners. Am I missing a version compatibility issue? I've written this plot before in 30secs but have spent too much time trying to figure out the issue here. Has anyone seen this before?