2
我對python/Matplotlib相對較新。我正在設法解決如何控制表格單元格中顯示的小數位數。如何將格式應用於Matplotlib表格中的單元格內容
例如;下面是創建一個表的代碼塊..但我想在每個單元只顯示到小數點後兩位的數據..
from pylab import *
# Create a figure
fig1 = figure(1)
ax1_1 = fig1.add_subplot(111)
# Add a table with some numbers....
the_table = table(cellText=[[1.0000, 3.14159], [sqrt(2), log(10.0)], [exp(1.0), 123.4]],colLabels=['Col A','Col B'],loc='center')
show()
僅供參考 - 我使用Python 2.6.5 =,= Matplotlib 1.2.0,numpy的= 1.7.0 – 2013-03-05 03:20:49