Reputation: 2191
I am new to data plotting, matplotlib or sns library. There is a
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
y = np.random.rand(10,4)
y[:,0]= np.arange(10)
df = pd.DataFrame(y, columns=["X", "A", "B", "C"])
df.head()
df.plot(x='X', y=['A', 'B', 'C'], kind='bar')
How can I plot df.plot(y='1.0', x=['A', 'B', 'C'], kind='bar')
# I want to put cell as X or Y axis.
I have copied the example from StackOverflow itself.
Upvotes: 0
Views: 2560
Reputation: 342
in the code below, you can select row values and graph them by their types, you can do this for each row, and you can analyse each col/row you want with it.
#df.plot(x='X',y=['A','B','C'],kind = 'bar')
y1 = df.iloc[0,1:].values #for first column (horizontal values)
x1 = ['A','B','C']
plt.plot(x1,y1)
this one was for 0.th row,
Upvotes: 2