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

How does Python import really work? In a chain of import
Django creating relation
Pairwise appending in python without ZIP [duplicate]
Python: Creating many instances of a class
Python Social Auth, Extending Disconnect Pipeline
Forward Euler N-Body Simulation in Python not returning correct results
OSError errno 13 Permission Denied Python CGI os.listdir
python encode the defined variable from txt file
Tkinter runtime error maximum recursion when open a window
Find out Python version from source code (or Heroku)
Recursive Function named Power
415 error when uploading to API
How to interfacing
Collision detection with PyGame
Why is Python not setting up my cron job's time properly?[Solved]
Training Data Set in NLTK Python

Categories

HOME
json
security
ssas-2012
app-inventor
ibm-watson-cognitive
angular-cli
visual-studio-2013
transparent
h2
automated-tests
rocketmq
phaser-framework
devstack
jframe
openwrt
aruco
getorgchart
cartodb
mongodb-query
zoomcharts
pyyaml
pyephem
flat-file
flexboxgrid
statusbar
fop
tflearn
novnc
searchbar
lync-2013
hash-collision
system.data.sqlite
dpi
fileinfo
gzip
vegan
outsystems
skygear
fractals
spreedly
mmdrawercontroller
installshield-2012
agent
s3cmd
brute-force
mediawiki-extensions
jrules
excel-interop
paho
vcf
defold
ti-basic
jenkins-jira-trigger
xmgrace
bnd
volume
butterknife
fontconfig
httplib2
verbose
pdflib
libreadline
firepath
gherkin
inotifypropertychanged
kendo-combobox
interactive-brokers
void
plone-3.x
affix
retro-computing
type-mismatch
hg-git
jai
hana-xs
alphablending
grunt-contrib-concat
fragment-tab-host
dmp
mov
emma
planetary.js
neoload
wss
joox
resource-files
visual-studio-addins
soa-suite
reporting-tools
mvs
tfs-power-tools
caliper
nssavepanel
nvelocity
querypath
trampolines
winverifytrust
pci-bus
plinq
callgrind
opcodes

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