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

IOError: [Errno 13] when specifying path for functions
How to specify the user data dir or profile dir (for cookies) in embedded Webkit?
django-tracking not working with django1.9
Astroquery SIMBAD : Obtaining data for diameter, mass, distance, luminosity and age of celestial object
Python- Module not having defined attribute
difference between two regular expressions: [abc]+ and ([abc])+
Model does not create a verion after deleting a foreign key model object (django-reversion)
How do I save the entire workspace in pandas (like RData)
Python: Read the content of a variable [duplicate]
How to use timeit for multiple values
Create tab separated print output from a list of tuples python
Print from keyword to end of sequence when sequence is multiple lines
select() on socket and another event mechanism
I try to create a GUI in python to read a file and write a new file but the syntax error shows up
URL common name matching - Python
Odd digit count python

Categories

HOME
cil
jar
websphere
textwatcher
boost-thread
thunderbird-addon
avro
google-sheets-api
h2
defragmentation
data-science-experience
currency
onenote-api
gimp
contact-form-7
goutte
finite-group-theory
dlib
symfony-forms
future
bar-chart
scenebuilder
apache-karaf
atlassian-plugin-sdk
chocolatey
clover
sql-update
nmake
dspic
richfaces
scalajs-react
croppic
pygooglechart
jboss5.x
apache-cloudstack
spring-insight
pdflatex
modelandview
salesforce-chatter
rhino
superpowered
passenger
text-files
dql
sql-like
jquery-multidatespicker
parent
tic-tac-toe
sendgrid-templates
excel-interop
crop
python-idle
bids
context-free-language
openweathermap
w3-total-cache
windows-firewall
rhel6
spring-data-hadoop
greenhills
tcserver
visual-studio-templates
payu
atlassian-crowd
c64
cron-task
dojox.charting
shipitjs
contour
approval-tests
intellitest
sevenzipsharp
ipojo
xjc
rx-groovy
twitter-rest-api
sparse-file
gulp-livereload
shift-jis
mdm-zinc
client-side-validation
orientation-changes
belongs-to
viewflipper
collabnet
csplit
yahoo-boss-api
wss
phpdocx
sgml
delphi-xe3
document-database
sttwitter
digital-design
fraud-prevention
code-conversion
mvccontrib
jpf
wchar
webkit-transform
posting
adsl
symbol-server
email-spec
libavformat
google-instant
evb

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