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

AttributeError: module 'xlwings' has no attribute 'save'
Images broadcast over UDP socket (Python)
Index class as list and as dictionary
Python “will the arrow fly straight program”
Processing an eventlog with Pandas - find next match in DataFrame
Intellij python plugin debugging the script copied under the target directory
Create a list with repeated values with list comprehension
Is LASSO regression implemented in Statsmodels?
There is a duplicate line showed when calling a __init__ in Python script
trouble with mousewheel + scrollbars in tkinter
Python Cutting a string on a certain point
Ansible become_user error UnicodeEncodeError: 'ascii' codec can't encode character
Dynamic way to create new columns as a function of existing columns in pandas
polymorphic dispatch: distinguishing Python integers vs. floating-point numbers vs. strings
HTCondor output files: obtain created directory
getting select values with flask [duplicate]

Categories

HOME
ember.js
itext
google-contacts
steam
json-ld
computer-vision
csvhelper
apple-numbers
java-home
jpanel
browserify
urlencode
facebook-javascript-sdk
xamarin-studio
cortex-a
jacoco
medium-editor
zope
google-api-java-client
multicore
esql
google-maps-android-api-2
multiplayer
logarithm
tfs2013
pdfsharp
pipelinedb
hanami
skmaps
osmdroid
invoke-command
referenceerror
read-write
ifstream
powershell-remoting
remote-server
nunit-3.0
duktape
wsadmin
android-maps-v2
intersystems-ensemble
taskmanager
multi-agent
persistent
shutdown
photography
typhoon
tomee
vst
children
django-filer
kendo-combobox
selecteditem
freefem++
post-processing
fortran90
portfolio
anythingslider
sonarqube5.3
getrusage
windows-vista
optionbutton
document-oriented-db
twython
ffserver
code-first-migrations
ember-components
jstat
power-law
bsp
cppdepend
operations
arangodb-php
exiv2
confusion-matrix
jqmobi
android-contextmenu
gdataxml
mvs
xgettext
symfony-2.0
rose-db-object
v4l
datacontract
audiostreamer
carbide
external-assemblies
usability-testing

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