Issue
I have a data set as shown below .I need to craete a line chart from this in such a way that all the columns shown in yellow color should come in the X axis and columns in Green color needs to come in the Y axis.May I know how to approch this.
I am expecting a plot like this shown below
Chart obtained after running the code
Solution
Could you please try with the following? As I stated in my comments, you would need to create an index value from the 3 columns you wish to use as X-axis:
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from pylab import rcParams
rcParams['figure.figsize'] = 12, 5
df = pd.read_excel(file_location).ffill()
sns.lineplot(x=df['Device_ID'].astype(str)+df['Temp(deg)'].astype(str)+'-'+df['Supply[v]'].astype(str),
y=df[2.4],color='r')
sns.lineplot(x=df['Device_ID'].astype(str)+df['Temp(deg)'].astype(str)+'-'+df['Supply[v]'].astype(str),
y=df[3.07],color='b')
plt.legend(['2.4','3.07'])
plt.ylabel('Frequency[MHz]')
plt.tick_params(axis='x',labelsize=8)
This outputs:
Answered By - Celius Stingher
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.