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

MultinomialNB: ValueError
Query on ReferenceProperty
How to extend inherited method by using original in python
Apache restart when developing python wsgi apps
can't execute pyw on windows
Pagination in Google App EngineSearch API
python max function with mixed strings and numbers
Automating launch of a python selenium script
Python asyncio, futures and yield from
Generate single-dimensional array with MySQL query
Error on assigning a value to a Rectangle in Pygame
Two python/pygame programs to run in the same window
Django Haystack and Elasticsearch Error Using rebuild_index
Can't keep a total of numbers in python
replace if else with a for loop
Panda3D - Setting date

Categories

HOME
vb6
warnings
puppet
wms
laravel-5.2
is-empty
azureservicebus
ext.net
keystore
jboss7.x
qt-installer
future
typeahead
eclipse-luna
riak
ssms-2016
apache-karaf
jcl
internet-explorer-8
mousewheel
kadanes-algorithm
jive
google-ima
jquery-scrollify
myob
auditing
version-numbering
vegan
encase
apache-cloudstack
shapes
data-extraction
pace
office365connectors
discord.net
cppunit
nstouchbar
pinvoke
tiddlywiki
workflow-foundation-4.5
windows-95
pluck
crystal-reports-8.5
rxvt
libtiff.net
android-navigationview
activeweb
update-site
foxit
asp.net-mvc-partialview
eml
fortran90
except
geodjango
document-oriented-db
ninject.web.mvc
sevenzipsharp
webhdfs
vine
web-component-tester
shift-jis
epl
jazz
jcr-sql2
rhel5
named-ranges
formvalidation-plugin
boost-test
lumx
sslexception
socketstream
pitch
qsqltablemodel
icefaces-3
xmlslurper
concurrent-programming
hobo
nintendo
newsstand-kit
pureftpd
clause
open-graph-beta
scala-2.8
google-instant
pci-bus
usability-testing
rd

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