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

aysncio cannot read stdin on Windows
Write multiple matches from regex to a file on a single line a certain way
one or more most frequent letter in string python
pandas - select/mask the first n elements by value
python filter files by modified time
Python, Multiprocessing: what to do if process.join() waits forever?
How to sum values in an iterator in a PySpark groupByKey()
Allauth will not save additional fields
Read Flask Session Cookie
How do I make my script take only numeric inputs without screwing it up
Incorrect output while reading text file in Python
PhantomJS - Permission Denied
Combining image RGB channels
Python input validation and edge case handling
Struggling with making a Python module accessible via PyPi
Finding the minimum and maximum of a list of arrays

Categories

HOME
cntk
dynamics-crm
amazon-swf
formal-verification
ruby-on-rails-3
laravel-4
rebol
filter
pygame
game-physics
scaling
uicollectionview
arm-template
fop
azure-servicebus-queues
mayavi
websauna
twitter-bootstrap-2
pari
entity-system
expand
receipt
pycparser
npm-publish
parse-android-sdk
sql-like
silverlight-3.0
installshield-2012
jupyter-console
tango
pytest-django
rapidweaver
vcf
jags
struts-layout
pluck
android-bitmap
pycurl
paas
redux-router
pspice
pdflib
gradle-script-kotlin
iostat
c64
manifest.mf
ruby-2.0
firepath
gitweb
coordinate-transformation
mongo-c-driver
mpeg-4
aerogear
java.util.calendar
schtasks.exe
document-oriented-db
eyeql
app.xaml
webhdfs
castle-windsor-3
gray-code
guzzle6
es2015
low-level
google-earth-plugin
jcr-sql2
start-job
activity-streams
jstat
system.web
ssms-addin
phpdocx
opensocial
gfs
pyjade
gridworld
zend-lucene
phpsh
code-conversion
deploying
file-exists
jpf
dcpu-16
phpcrawl
server-error
linfu
swfloader
writing

Resources

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
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App