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

Need help optimizing a loop with 3 dataframes
Running a python script locally works but through travis-ci it fails, what could be the reason?
How to find the point between two points on a circle in 3D?
How to update the value of a key in a dictionary in Python?
Refreshing an element only with Python Requests
Google Geocoding returns false address
Entering a Changing Class Object into a List for Python
Sending ID from HTML to Flask Python
Logging natively or by library?
autobahn web socket push update to clients
Axis interval spacing when plotting with pandas timedelta
Does statsmodels WLS have get_influence() function?
Django Forms forms.DateInput / forms.DateField: formatting inconsistency between {{ form.datefield }} and {{ form.datefield.value }} in template code
Making cv2.createTrackbar specified step size and discard certain values
How to get metadata of RTSP in Python?
Implementing REST API in Python with existing asyncio event loop

Categories

HOME
sql-server-2008
paypal
visual-studio-2015
ember.js
ssas-2012
udp
boost-thread
zend-framework2
search-engine
is-empty
java-home
browserify
onenote-api
vuex
packer
metronic
cartodb
rfid
iso
game-maker-studio-1.4
cs-cart
glpk
scaling
riak-ts
saiku
flat-file
propel2
thumbnails
shippo
esql
source-maps
myob
kong
excel-2013
pcre
gpib
crt
apache-cloudstack
helix-3d-toolkit
stocks
gettext
large-data
openpgp
nunit-3.0
inkscape
coreclr
strstr
cross-entropy
dojox.mobile
filepath
onmouseover
goquery
xmgrace
lotus
iron.io
shinyjs
android-navigationview
manifest.mf
angularjs-ng-pattern
tuxedo
foxit
pagekit
remoteapp
dac
asynccallback
axes
acm
getrusage
jta
mirrorlink
uialertview
urn
risk-analysis
findcontrol
jazz
ember-cli-addons
cppdepend
ssms-addin
visualstatemanager
sanitization
xslkey
qt4.6
bulbs
returnurl
usn
qsqltablemodel
printing-web-page
smooth
junit3
pantheios
carbide
windows-controls
usergroups

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