一連の要素の 2 つの異なる分類を比較しようとしています。次のようなグラフィックを取得したいとします。
次の iPython セッションで取得:
In [1]: df
Out[1]:
<class 'pandas.core.frame.DataFrame'>
Index: 446 entries, element0 to element445
Data columns (total 2 columns):
Classification1 446 non-null values
Classification2 446 non-null values
dtypes: int64(2)
In [2]: pylab.pcolor(df, cmap='Oranges')
Out[2]: <matplotlib.collections.PolyCollection at 0x55dc650>
In [3]: pl.show()
1) 2 つの分類で同じ値に同じ色が使用されているかどうかを確認するにはどうすればよいですか? すなわち。2 つの分類で同じ色を持つ element1 も同じ値を持つかどうかをテストするにはどうすればよいですか (たとえば、Classification1 と Classification2 の両方で 1 として分類されます)。使用しようとしましたが、次のように表示されpl.legend()
ます。
In [54]: pl.legend()
/usr/lib/pymodules/python2.7/matplotlib/axes.py:4486: UserWarning: No labeled objects found. Use label='...' kwarg on individual plots.
warnings.warn("No labeled objects found. "
2) 2 つの分類をグラフィカルに比較するより良い方法はありますか?
ありがとう