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

What is the difference between scipy.integrate.odeint and scipy.integrate.ode?
Django: How to write groups and where those groups live?
Using user input to access a variable in python
String replacement in excel using Python
Read a File and Count Characters from an inputted txt file from user
OpenCV camera just showing black output
Why am I getting an empty row in my dataframe after using pandas apply?
List circulation in Python for Project Euler 37
Python lists, pairing and writting
searching sickbeard api output and print only keyword line
Flask-Restless API Endpoints only work sometimes
Matplotlib tight_layout causing RuntimeError
Strange behaviour of ref counter with ints being 0
self.assertTrue(post.text in response.content) – Assertion Error
How to add a path to sys.path permanently [duplicate]
Copy C structure to Python List

Categories

HOME
xbox-live
vue.js
vb6
angular-cli
webrtc
google-tag-manager
jasmine
d
thunderbird-addon
proguard
eval
window
rfid
public-key-encryption
qt-installer
lstm
titan
off-canvas-menu
pyephem
vs2017
cocoa-touch
piwik
rworldmap
printdocument
hanami
rhmap
invoke-command
lmdb
polymorphism
gettext
threshold
nlb
.net-assembly
fax
distributed-transactions
android-maps-v2
fastq
worker
asmx
amazon-clouddrive
fqdn
gist
cgcontext
volume
heroku-postgres
selenium-firefoxdriver
settimeout
sql-import-wizard
easing
brython
spatial-query
spinlock
qt-linguist
interactive-brokers
portfolio
galaxy
multinomial
java.util.calendar
qbfc
sevenzipsharp
built-in
prezto
rx-groovy
crash-dumps
obfuscar
viewflipper
fragment-tab-host
em
ember-components
alpha-transparency
cppdepend
slick-2.0
dynamic-proxy
cilk-plus
goinstant
ng-hide
grunt-contrib-compass
client-library
vt100
git-filter-branch
vim-powerline
scrollto
pstree
plone-funnelweb
v4l
delegatecommand
openvg
multibyte-functions
dirty-data

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