I want to plot two DataFrame in a single plot.Though, I have seen similar post but none seems to work out.
First 5 rows of my dataframe looks like this:
df1
name type start stop strand
0 geneA transcript 2000 7764 +
1 geneA exon 2700 5100 +
2 geneA exon 6000 6800 +
3 geneB transcript 9000 12720 -
4 geneB exon 9900 10100 -
df2
P1 P2 P3 P4
0 0.28 0.14 0.19 0.19
1 0.30 0.16 0.17 0.20
2 0.26 0.13 0.20 0.12
3 0.21 0.13 0.25 0.15
4 0.31 0.03 0.24 0.20
I want the plot to look like this:
I tried doing this:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
ax = df1.plot()df1.plot(ax=ax)
but, the output was not meaningful. I will appreciate suggestions/solutions on how to achieve this.