I have two dataframes which each have n columns (changes depending input), where each dataframe represents an axis coordinate. Each column represents separate lines I want to plot.
Example dfs (1st being x coordinates, 2nd being y coordinates):
I've looked at multiple threads on here and have tried to df.concat, create a df3 with tuple coordinates. The problem is that all the solutions often require plotting each column separately. However, I need this to be variable to the number of columns I generate based on my inputs.
My current code:
#Using datapull
from jdK_RS import RelStr, rsMOM
rs= RelStr
rsMO = rsMOM
#Remove first row and column so all points are plottable
rs = rs.iloc[1:,:]
rsMO = rsMO.iloc[1:,:]
#Create legend from the column headers
legend = rs.columns.values.tolist()
#Combine the matrices to develop plots
rrg = pd.DataFrame()
rrg.reindex_like(rs)
rrg = pd.DataFrame({x: zip(rs[x], rsMO[x]) for x in rs.columns})
#Plot RRG
plt.plot(rrg)
plt.figure(figsize=(8,8))
plt.legend(legend)
plt.show()
When I plot a scatter, it plots the points correctly, but unfortunately does not create the separate lines I need for my analysis. As an example of the type of visual I'd like...