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

Combining two lists of names and sorting them to make one sorted list of names
Python equivalent of bash sort lexicographical and numerical
Why isn't my frames background showing?
Trying to do a natural join using python standard library
How to combine several querysets by key in common?
How I can speed up row column access to pandas dataframe?
Create list with combinations of 3 elements of other list with repetitions
PyQt5 does not change gifs
Pydub - combine split_on_silence with minimum length / file size
how to choose python version accordingly in pycharm?
Unable to import Flask to Kivy iOS
Unique list without spliting entries based on spaces in python
Uncaught SyntaxError: Unexpected token & error for flask and html
Django celery tasks working very long
Python, create plot from DataFrame
having this error TypeError: cannot concatenate 'str' and 'int' objects when trying to do math with variables stored with pickle

Categories

HOME
paypal
converter
jdbc
symfony
ibm-watson-cognitive
nlp
jsviews
decorator
mapbox-gl-js
recyclerview
webdav
iis-7.5
docker-windows
sudo
dropbear
eclipse-cdt
criteria
ndis
rfid
ejs
derived
google-api-java-client
pycrypto
koa
plsqldeveloper
raphael
explode
novnc
xor
svnkit
clockwork
read-write
qtablewidget
jquery-cycle2
xamarin.uitest
axis-labels
android-preferences
flex4.5
stdclass
viewgroup
service-fabric-stateful
taglib
matlab-cvst
ogre3d
udev
photography
react-native-fbsdk
pycurl
garrys-mod
settimeout
libreadline
alter
activeweb
git-annex
visible
zurb-foundation-apps
instruments
nofollow
qregexp
concur
void
file-diffs
mysqldumpslow
ipojo
adodb
ticket-system
start-job
client-side-validation
c++-actor-framework
belongs-to
omnifocus
microblaze
adcolony
java-collections-api
proxies
visualstatemanager
opensocial
broadcasting
trimming
sttwitter
multiple-login
ruboto
windows-update
localtime
xml-libxml
lync-server-2010
attachevent
applicationcontext
law-of-demeter
flexicious
for-xml-path
configurable
standardized
visual-studio-dbpro





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android


MS Developer
developer works
python
ios
c
html
jquery


RDBMS discuss