Iは、以下パンダのデータフレームdf
有する:私のデータセットの複数行プロットを作成するには?
df = pd.DataFrame(columns=["Event1", "Event2", "Event3"],
data=[[15,1,22],
[16,1.26,80],
[27,0,15]])
df = df.set_index([["Series1", "Series2", "Series3"]])
をIは、Y軸は対応する数値であるべきであるが、Event1
、Event2
とEvent3
を含むX軸と複数行のプロットを作成します。 3つのシリーズ:Series1
,Series2
,Series3
があります。
どのように私はsns.pointplot(x=???, y=???, hue=???,data=df)
にx
、y
とhue
を定義することができますか?
plt.figure(figsize=(12,8))
ax = sns.pointplot(x=???, y=???, hue=???,data=df)
ax.grid(b=True, which='major', color='#d3d3d3', linewidth=1.0)
ax.grid(b=True, which='minor', color='#d3d3d3', linewidth=0.5)
plt.show()
'sns.pointplot'を使用するか、希望のプロットを得るための最も簡単な方法を取得する目的ですか? – ImportanceOfBeingErnest
@ImportanceOfBeingErnest:理想的には、シーボーンのポイントプロットを使用したいと考えています。しかし私は純粋な 'matplotlib'も受け入れます。 – Dinosaurius