2
pylab_examplesに続いて、私はmatplotlibに単純な2x5セルテーブルを作成しました。Matplotlibテーブルの特定のセルに特定の色を割り当てる方法は?
コード:
# Prepare table
columns = ('A', 'B', 'C', 'D', 'E')
rows = ["A", "B"]
cell_text = [["1", "1","1","1","1"], ["2","2","2","2","2"]]
# Add a table at the bottom of the axes
ax[4].axis('tight')
ax[4].axis('off')
the_table = ax[4].table(cellText=cell_text,colLabels=columns,loc='center')
今、私はcolor = "#1ac3f5"
でcolor = "#56b5fd"
と、セルA1とセルA2を色付けしたいです。その他のセルはすべて白色のままにしてください。 Matplotlibのtable_demo.pyとthisの例では、セルの値に依存する事前定義された色でカラーマップを適用する方法を示しています。
Matplotlib生成テーブルの特定のセルに特定の色を割り当てる方法はありますか?