python


Python Matplotlib how to get table only


I modified the example code and got the table to work the way I want, however, there's still a box where the graph would go below the table. I want to get rid of that box. Note that the table has 5 rows including column lables and 8 columns including row lables.
The relevant code:
columns = ('Last', 'High', 'Low', 'Chg.', 'Chg. %', 'Time', 'T?')
rows = ['Gold', 'Silver', 'Copper', 'Aluminum']
scatter_x = (1, 2, 3)
scatter_y = (1224.53, 1231.76, 1228.70)
fig = plt.figure(1)
gridspec.GridSpec(4,3)
#Table - Main table
plt.subplot2grid((4,3), (0,0), colspan=2, rowspan=2)
plt.table(cellText=data_list,
rowLabels=rows,
colLabels=columns,
loc='top')
plt.subplots_adjust(left=0.2,top=0.8)
plt.yticks([])
plt.xticks([])
#Gold Scatter - Small scatter to the right
plt.subplot2grid((4,3), (0,2))
plt.scatter(scatter_x, scatter_y)
plt.ylabel('Gold Last')
fig.tight_layout()
fig.set_size_inches(w=6, h=5)
fig_name = 'plot.png'
fig.savefig(fig_name)
plt.show()
And it produces this:
A tack on question: how would I set the padding on the table so it's not cut off at the top and left?


Related Links

print a column instead of list in python matrix
Migrating from Google App Engine Backends to Modules
How can I change the dpi of an image in PythonMagick?
Special kind of row-by-row multiplication of 2 sparse matrices in Python
itertools.product: how to improve the performance?
Accented Letters - Python 3.3 and Beautiful Soup 4 [Solved]
Max and Min of Frequency Both Returning Same Value
No module named admin.sites.urls
Python issue with if statement
Determing encoding of “file.ini”
Running an .exe script from a VB script by passing arguments during runtime
Django admin search and edit foreign fields
Django-Nonrel AbstractUser Permissions
What's the purpose of dictproxy?
Azure Python: blob_service.set_blob_metadata(…) deletes/overrides the last edited/set metadata(error)
“Batch” renaming one file at a time in Python

Categories

HOME
erlang
fparsec
formal-verification
visualization
h2
search-engine
is-empty
value
docker-windows
facebook-javascript-sdk
lotus-notes
criteria
wicket
jboss-eap-7
spinnaker
ctypes
game-physics
lstm
rhapsody
ms-access-2007
styles
excel-2010
rails-activerecord
philips-hue
python-textprocessing
sumo
ab-initio
chrome-native-messaging
positioning
xor
getjson
rowcount
android-vpn-service
gettext
passenger
hashcat
parent
polyfills
flex4.5
rich-text-editor
w3-total-cache
sgmlreader
applepayjs
shutdown
spring-data-hadoop
nuget-server
info
mercury
festival
hspec
backstop.js
galleriffic
software-product-lines
inotifypropertychanged
dbscan
yoothemes
xmp
cmocka
except
difference
anythingslider
throughput
coldfusion-7
affix
mysqldumpslow
mogrify
twython
lines-of-code
apache-mina
epl
consensus
line-numbers
omnifocus
io.js
cppdepend
kraken.js
reserved-words
layered
goinstant
justgage
grunt-contrib-compass
mailcore
client-library
snapjs
domain-calculus
transitive-closure-table
zend-framework-modules
n-layer
isolatedstorage
law-of-demeter
webkit-transform
ou
noir
search-path
adobe-contribute
libavformat
pantheios
svn-hooks
boost-date-time
act
cots





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm