Color in table help please! I have already searched previous posts

I am trying to make the table at the bottom and the lines the same color. I
took the code from one of the online examples and modified it to do most of
what I want but cannot get the color in the table working properly! Can
someone please help? Thank you

#!/usr/bin/env python
import matplotlib
from pylab import *
from matplotlib.colors import colorConverter

color3=(1,0,0)
axes([0.2, 0.2, 0.7, 0.6]) # leave room below the axes for the table

data = [[
100.00,349.75,171.44,625.53,134635.8,248978.4,160392.1,179662.4,123550.5],
        [
235998.8,99972.15,242081.6,84912.13,243705.3,247201.2,203676.4,90139.60,113332.5],
        [
202610.0,127785.3,182007.1,175678.0,154024.1,188675.2,166227.0,94719.93,160227.7],
        [
31699.09,30586.87,30587.58,33440.05,32209.72,34223.97,28250.25,32070.29,19095.30],
        [
84414.35,21884.88,49538.22,49200.55,42394.29,66676.73,57740.81,73549.68,48402.48],
        [ 0.0,0.0,0.0,0.0,023529.88,19822.02,35243.35,34349.67,19382.45]]

title('Title')
colLabels = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep')
rowLabels = ['Dr %d' % x for x in (1, 2, 3, 7, 8, 10)]

linecolor = ('blue','red','green','black','yellow','cyan','magenta')

rows = len(data)

ind = arange(len(colLabels)) # the x locations for the groups
cellText = []
yoff = array([0.0] * len(colLabels)) # the bottom values for stacked bar
chart
for row in xrange(rows):
    plot(arange(0,9), data[row],color=linecolor[row])
    yoff = data[row]
    cellText.append(['%1.2f' % (x) for x in yoff])
# Add a table at the bottom of the axes

#title([color3])
the_table = table(cellText=cellText,
                  rowLabels=rowLabels, rowColours=[color3]*16,
                  colLabels=colLabels,
                  loc='bottom')
vals = arange(0, 350000, 25000)
yticks(vals, ['%d' % val for val in vals])
xticks([])
savefig("tony.png",dpi=(1024/8))

···


View this message in context: http://old.nabble.com/Color-in-table-help-please!--I-have-already-searched-previous-posts-tp27613553p27613553.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Do you want the background of the row labels to match your line colors?
The answer seems to be so trivial and I'm not sure if this is what you want.

the_table = table(cellText=cellText,
                 rowLabels=rowLabels, rowColours=linecolor,
                 colLabels=colLabels,
                 loc='bottom')

-JJ

···

On Tue, Feb 16, 2010 at 2:15 PM, duckman <tduckett@...2981...> wrote:

I am trying to make the table at the bottom and the lines the same color. I
took the code from one of the online examples and modified it to do most of
what I want but cannot get the color in the table working properly! Can
someone please help? Thank you

That actually did it. I thought I had tried this several times and kept
getting errors. It would not take the color names like red, blue etc. But
when I changed it as suggested it worked!

Thank you!

Jae-Joon Lee wrote:

···

On Tue, Feb 16, 2010 at 2:15 PM, duckman <tduckett@...2981...> > wrote:

I am trying to make the table at the bottom and the lines the same color.
I
took the code from one of the online examples and modified it to do most
of
what I want but cannot get the color in the table working properly! Can
someone please help? Thank you

Do you want the background of the row labels to match your line colors?
The answer seems to be so trivial and I'm not sure if this is what you
want.

the_table = table(cellText=cellText,
                 rowLabels=rowLabels, rowColours=linecolor,
                 colLabels=colLabels,
                 loc='bottom')

-JJ

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


View this message in context: http://old.nabble.com/Color-in-table-help-please!--I-have-already-searched-previous-posts-tp27613553p27623776.html
Sent from the matplotlib - users mailing list archive at Nabble.com.