ValueError: Domain error on eval_scalars in RendererAgg::draw_regpoly_collection

I get this error:

ValueError: Domain error on eval_scalars in RendererAgg::draw_regpoly_collection

when I try to plot the scatter below. Can anyone tell me what this error means? It is completely
greek to me. Again, sorry for the huge data sample but you know...gotta be accurate.

Thanks,
Derek Basch

import matplotlib
from pylab import *

def roundUpLogDecade(x):
    """ Round up to the nearest logarithmic decade"""
    return 10**math.ceil(math.log10(x))

def log10Product(x, pos):
    """The two args are the value and tick position.
    Label ticks with the product of the exponentiation"""
    return '%1i' % (x)

prediction_experiment = [(15305.6, 18811.900000000001), (16211.4, 32857.099999999999),
(95.900000000000006, 20.534500000000001), (22925.599999999999, 1096.29), (20800.299999999999,
50000.0), (8256.3999999999996, 19166.700000000001), (61.600000000000001, 14.3163),
(2067.6999999999998, 19.166699999999999), (18.800000000000001, 166.52000000000001),
(14272.799999999999, 966.96500000000003), (3024.8000000000002, 28204.400000000001), (100.7,
1437.5), (16.300000000000001, 7.1875), (10.300000000000001, 1.38544), (1557.7, 13915.6), (14693.0,
8846.1499999999996), (0.90000000000000002, 3.0666699999999998), (167.30000000000001,
2468.8699999999999), (49.200000000000003, 44.230800000000002), (632.0, 88.8673),
(156.80000000000001, 37.096800000000002), (55.0, 359.0), (6.5999999999999996, 1.0), (666.0,
38.677799999999998), (965.20000000000005, 307.69799999999998), (999.0, 333.27600000000001),
(1391.2, 24215.900000000001), (1034.5, 1230.1300000000001), (3876.9000000000001,
1065.8599999999999), (1012.7, 14122.0), (1142.7, 338.78699999999998), (2498.3000000000002,
7048.6499999999996), (610.39999999999998, 16166.799999999999), (5880.3000000000002,
2148.8499999999999), (1208.4000000000001, 124.51000000000001), (3771.4000000000001,
6958.2200000000003), (704.10000000000002, 1308.9100000000001), (1541.2, 975.33500000000004),
(1262.4000000000001, 1434.22), (756.60000000000002, 445.27999999999997), (660.39999999999998,
6917.1700000000001), (858.20000000000005, 604.55700000000002), (906.89999999999998,
4903.1700000000001), (885.60000000000002, 1712.1500000000001), (848.5, 3.5920999999999998),
(730.89999999999998, 1325.8199999999999), (529.10000000000002, 603.10699999999997),
(883.29999999999995, 494.04599999999999), (368.10000000000002, 882.39499999999998),
(635.10000000000002, 274.40100000000001), (786.29999999999995, 195.446), (605.5,
31.575600000000001), (947.39999999999998, 232.23099999999999), (143.69999999999999, 60.1965),
(184.69999999999999, 106.23099999999999), (130.59999999999999, 1731.3199999999999),
(216.69999999999999, 2357.0100000000002), (101.2, 1.6222399999999999), (184.69999999999999,
4893.1899999999996), (184.69999999999999, 4791.71), (2.0, 56.9193), (130.59999999999999,
1535.3399999999999), (24.600000000000001, 220.05600000000001), (40.5, 184.017),
(216.69999999999999, 4331.5299999999997), (130.59999999999999, 6743.8500000000004),
(130.59999999999999, 4601.6700000000001), (279.39999999999998, 1592.9300000000001),
(85.900000000000006, 709.89099999999996), (118.0, 38.137799999999999), (18.300000000000001,
1.9705900000000001), (75.900000000000006, 87.005099999999999), (707.70000000000005,
492.86399999999998), (706.89999999999998, 1018.73), (52.200000000000003, 79.310299999999998),
(918.10000000000002, 149.92699999999999), (849.20000000000005, 259.23000000000002), (366.0,
7802.0900000000001), (590.89999999999998, 913.01499999999999), (850.10000000000002,
2007.8699999999999), (4047.5, 74193.5), (643.10000000000002, 103.756), (8435.7000000000007,
2286.3200000000002), (276.69999999999999, 50000.0), (37.0, 5.2272699999999999),
(294.60000000000002, 14.93), (4.0, 1.0), (32.899999999999999, 28.395099999999999),
(78.700000000000003, 460.0), (1823.8, 50000.0), (636.70000000000005, 94.134600000000006), (14.1,
3.6507900000000002), (372.19999999999999, 1036.97), (38.399999999999999, 1.0),
(1.3999999999999999, 4.5999999999999996), (15540.0, 32857.099999999999), (15641.9,
32857.099999999999), (15540.0, 26650.700000000001), (15305.6, 32857.099999999999), (16211.4,
11600.200000000001), (16831.400000000001, 32857.099999999999), (8643.1000000000004,
86746.100000000006), (57382.599999999999, 4004.6500000000001), (274.0, 438.07900000000001),
(18462.5, 16857.200000000001), (15540.0, 15064.9), (15540.0, 13152.5), (15305.6,
30666.700000000001), (18462.5, 19247.0), (18462.5, 19449.700000000001), (18462.5,
23263.400000000001), (18462.5, 30666.700000000001), (15540.0, 30666.700000000001), (331.5,
10.0541), (1388.4000000000001, 704.97299999999996), (69.0, 247.31200000000001),
(808.20000000000005, 50000.0), (323.60000000000002, 36.847999999999999), (42.700000000000003,
153.333), (3.8999999999999999, 8.7948199999999996), (750879.0, 42069.300000000003),
(53758.900000000001, 50000.0), (317958.0, 32394.400000000001), (238.19999999999999,
82.269099999999995), (11867.200000000001, 26136.400000000001), (1428.4000000000001,
6121.3800000000001), (3364.6999999999998, 10454.5), (2498.6999999999998, 8518.5200000000004),
(49.200000000000003, 4339.6199999999999), (113185.0, 19607.299999999999), (26920.900000000001,
50000.0), (34519.099999999999, 28082.200000000001), (1513.3, 39655.199999999997), (12586.6,
69697.0), (2835.9000000000001, 6862.1999999999998), (46922.400000000001, 92000.0),
(1812.4000000000001, 6571.4300000000003), (40.299999999999997, 11.0953), (20960.900000000001,
1009.1900000000001), (374.60000000000002, 1272.22), (118348.0, 50000.0), (1429.0,
3709.6799999999998), (17617.299999999999, 109.708), (95979.800000000003, 50000.0), (1418.8,
12777.799999999999), (17760.700000000001, 11634.299999999999), (79792.100000000006,
6213.1700000000001), (142226.0, 19392.400000000001), (252.5, 8214.2900000000009),
(13683.299999999999, 51111.099999999999), (3855.8000000000002, 7269.04), (2225.1999999999998,
1000.0), (2771.0999999999999, 766.66700000000003), (1970.2, 541.28800000000001),
(8354.7000000000007, 95123.0), (676.20000000000005, 4893.6199999999999), (1256.0999999999999,
23000.0), (16.0, 1.0), (132.19999999999999, 115.0), (5450.1999999999998, 821.42899999999997),
(1751.3, 50000.0), (939.60000000000002, 153.333), (2664.0999999999999, 50000.0),
(781.89999999999998, 2987.0100000000002), (651.70000000000005, 43396.199999999997),
(2825.5999999999999, 8518.5200000000004), (2503.0999999999999, 15713.700000000001),
(212.19999999999999, 1.5756699999999999), (4.2999999999999998, 460.0), (7777.8999999999996,
143750.0), (4362140.0, 17767.099999999999), (29821.5, 11853.0), (1132840.0, 460000.0),
(7106.6999999999998, 26293.700000000001), (9652.8999999999996, 50000.0), (516.79999999999995,
4423.0799999999999), (61663.800000000003, 10952.4), (721.60000000000002, 1273.6099999999999),
(1196.4000000000001, 11.914199999999999), (46.0, 460.0), (90.5, 2.6690100000000001),
(1161.9000000000001, 3898.9699999999998), (225.90000000000001, 15.386799999999999), (36.0,
48.936199999999999), (908.5, 1073.02), (576.89999999999998, 1209.6500000000001),
(790.29999999999995, 79211.899999999994), (495.10000000000002, 220.14599999999999),
(531.79999999999995, 104.545), (27090.700000000001, 8518.5200000000004), (44.0,
179.31200000000001), (567.29999999999995, 1045.45), (627.39999999999998, 11235.700000000001),
(319.60000000000002, 1415.75), (9.3000000000000007, 1.0), (51.899999999999999,
206.59100000000001), (405.0, 7419.3500000000004), (1038.5, 4302.5200000000004),
(1450.4000000000001, 49.071800000000003), (2651.4000000000001, 2300.0), (170.30000000000001,
271.03800000000001), (88.200000000000003, 1277.78), (102.2, 101.0), (122.59999999999999,
8.8461499999999997), (791.0, 665.01800000000003), (208.40000000000001, 38983.099999999999),
(1045.2, 4.8056799999999997), (393.10000000000002, 100.0), (3.6000000000000001, 1.0),
(8.8000000000000007, 2.5555599999999998), (102.40000000000001, 5.0898199999999996),
(1145.4000000000001, 425.92599999999999), (16002.200000000001, 3610.7199999999998),
(62966.599999999999, 766667.0), (3255.1999999999998, 51048.099999999999), (8068.3000000000002,
12.2407), (123.09999999999999, 127.441), (112.40000000000001, 8233.8600000000006),
(1.1000000000000001, 1.33012), (3980.6999999999998, 46000.0), (4029.9000000000001,
18471.700000000001), (2442.0999999999999, 35.3872), (27480.200000000001, 383333.0),
(210.59999999999999, 7.8554399999999998), (214951.0, 14375.0), (22775.099999999999,
17003.400000000001), (84.700000000000003, 46000.0), (427.0, 209.09100000000001),
(1047.4000000000001, 12177.700000000001), (19.699999999999999, 21.231400000000001),
(291.39999999999998, 38.9831), (2850.8000000000002, 39352.199999999997), (1706.0, 7187.5), (22.0,
9.8006200000000003), (1572.3, 31.756900000000002), (598.60000000000002, 6017.3999999999996),
(45.399999999999999, 1.7382500000000001), (7.5, 3.1923599999999999), (55.399999999999999,
14.9993), (20365.299999999999, 40954.099999999999), (2579.9000000000001, 16213.299999999999),
(2464.0999999999999, 433.96199999999999), (24398.900000000001, 176923.0), (8599.7999999999993,
7178.3900000000003), (2442.1999999999998, 8518.5200000000004), (33161.900000000001, 71875.0),
(17153.799999999999, 26515.700000000001), (2569.0, 1866.5799999999999), (5.7999999999999998,
7.6666699999999999), (3234.8000000000002, 8729.7999999999993), (73.299999999999997,
338.23500000000001), (9.6999999999999993, 19.254000000000001), (2517.6999999999998,
2216.4400000000001), (890.5, 1410.6199999999999), (136.5, 328.57100000000003),
(103.90000000000001, 11.7334), (6.4000000000000004, 4.8936200000000003), (32.399999999999999,
252.74700000000001), (61.5, 109.524), (3413.0, 676.471), (142.30000000000001, 3.9655200000000002),
(22.699999999999999, 1.0), (895.5, 1343.4200000000001), (324.69999999999999, 479.16699999999997),
(97.299999999999997, 482.0), (2712.0999999999999, 43396.199999999997), (165.0,
2.4984600000000001), (7.2999999999999998, 1.00952), (11.199999999999999, 1.0), (1748.2, 1698.52),
(82.200000000000003, 34.445399999999999), (21891.700000000001, 383333.0), (1838.4000000000001,
409.54399999999998), (727.0, 958.33299999999997), (72453.600000000006, 50000.0),
(905.10000000000002, 6656.6099999999997), (25946.0, 50000.0), (1267.0, 51111.099999999999),
(1128.3, 38.956400000000002), (1930.5, 888.99699999999996), (932.0, 3593.75), (246.59999999999999,
79.310299999999998), (1658.9000000000001, 492.55099999999999), (2.5, 50000.0),
(491.60000000000002, 433.96199999999999), (389.10000000000002, 32.055999999999997),
(284.30000000000001, 209.09100000000001), (0.0, 1.0), (1340.4000000000001, 61.305),
(2080.3000000000002, 14.007099999999999), (38978.0, 36475.800000000003), (922.10000000000002,
460.0), (430.0, 718.75), (15.9, 1.0), (449.0, 115.0), (152.5, 5000.0), (1378.5999999999999,
638.88900000000001), (38795.400000000001, 383333.0), (36800.199999999997, 2534.9899999999998),
(26164.400000000001, 2562.3499999999999), (14170.299999999999, 50000.0), (442.60000000000002,
21576.400000000001), (2515.8000000000002, 179.709), (4841.1999999999998, 605.26300000000003),
(32.899999999999999, 1.0), (889.39999999999998, 1206.7), (4249.3999999999996, 29742.5),
(777.79999999999995, 1000.0), (34.799999999999997, 20.7027), (64.299999999999997,
64.324600000000004), (39977.0, 13295.0), (9984.6000000000004, 695.58900000000006),
(3540.4000000000001, 1806.78), (3767.8000000000002, 46831.599999999999), (56914.099999999999,
5708.1899999999996), (4645.6999999999998, 851.85199999999998), (216.40000000000001, 50000.0),
(602.0, 27.278600000000001), (4304.6000000000004, 62162.199999999997), (6885.6000000000004,
35937.5), (14.1, 20.273900000000001), (15455.0, 15240.1), (2835.0999999999999, 31135.5),
(27447.299999999999, 11928.799999999999), (81.400000000000006, 20.2743), (1040.3,
2622.5300000000002), (619.39999999999998, 793.10299999999995), (2281.4000000000001,
801.94500000000005), (1546.4000000000001, 15333.299999999999), (225051.0, 6987.0),
(36433.400000000001, 50000.0), (198431.0, 38333.300000000003), (1167750.0, 79310.300000000003),
(25351.299999999999, 7490.6499999999996), (29013.5, 17831.599999999999), (100582.0,
82142.899999999994), (1704.0999999999999, 8846.1499999999996), (710.70000000000005, 1.0),
(4711.6000000000004, 57500.0), (21238.299999999999, 19166.700000000001), (17927.900000000001,
60526.300000000003), (540.70000000000005, 5269.2200000000003), (22351.700000000001,
25748.799999999999), (47715.599999999999, 365.07900000000001), (429.80000000000001,
12777.799999999999), (30052.5, 13283.4), (1074.8, 10795.0), (6114.1999999999998, 383333.0),
(79.599999999999994, 3098.2600000000002), (178.40000000000001, 135.62299999999999), (954.5,
17.468399999999999), (21802.700000000001, 1870.8299999999999), (148.0, 3538.46),
(931.10000000000002, 17.999400000000001), (2401.0999999999999, 958.33299999999997),
(5443.3000000000002, 527.14499999999998), (900.20000000000005, 50000.0), (1237.5,
643.03499999999997), (276.30000000000001, 153.84399999999999), (294.0, 1.0), (287.19999999999999,
5476.1899999999996), (2090.0, 47022.199999999997), (613.79999999999995, 6969.6999999999998),
(143.0, 88.652199999999993), (1493.3, 489.36200000000002), (42878.5, 64950.0),
(14928.299999999999, 460000.0), (13958.9, 5287.1000000000004), (3624.6999999999998,
51111.099999999999), (5290.3999999999996, 58420.099999999999), (888.60000000000002,
2028.9400000000001), (113587.0, 121053.0), (3165.3000000000002, 6660.29), (162.69999999999999,
3194.4400000000001), (412.10000000000002, 8.4493600000000004), (208.5, 88.461500000000001), (88.0,
3.9503699999999999), (89.5, 1.81321), (550.39999999999998, 1477.74), (109.8, 35.077800000000003),
(76.5, 766.66700000000003), (150.59999999999999, 56.0976), (173.69999999999999,
16428.599999999999), (167.59999999999999, 50.0), (624.10000000000002, 83.306200000000004),
(38.600000000000001, 16.428599999999999), (7.5, 2.09091), (145.30000000000001, 13.7507),
(2064.1999999999998, 170.78800000000001), (6483.1000000000004, 231.233), (399.10000000000002,
6589.2399999999998), (5789.6000000000004, 10130.299999999999), (9468.2999999999993,
4259.2600000000002), (1445.0, 34.543700000000001), (544.89999999999998, 2.7040999999999999),
(9.8000000000000007, 7.9310299999999998), (875.89999999999998, 53488.400000000001),
(295.30000000000001, 54.761899999999997), (24.800000000000001, 450.98000000000002),
(9.8000000000000007, 13.529400000000001), (1372.5, 16428.599999999999), (348.5,
33.823500000000003), (0.90000000000000002, 1.9438599999999999), (375.19999999999999, 1045.45),
(86.700000000000003, 74.789299999999997), (196.80000000000001, 920.0), (91.0, 34.517299999999999),
(396.10000000000002, 821.42899999999997), (81.700000000000003, 6.0526299999999997),
(5.4000000000000004, 3.4328400000000001), (494.69999999999999, 4061.96), (133.0,
26.364699999999999), (2.7999999999999998, 1.5333300000000001), (29258.400000000001, 460000.0),
(39836.400000000001, 100000.0), (8263.6000000000004, 10774.299999999999), (3795.1999999999998,
22952.700000000001), (1897.8, 884.61500000000001), (3398.8000000000002, 4035.0900000000001),
(121.5, 1779.04), (3144.1999999999998, 50000.0), (69321.800000000003, 115000.0),
(6019.3999999999996, 582.62900000000002), (1.3, 76.666700000000006), (8979.7000000000007,
13303.700000000001), (11626.5, 442.81299999999999), (15622.5, 9417.3799999999992), (1158750.0,
766667.0), (277013.0, 766667.0), (15045.299999999999, 18330.299999999999), (32308.0,
18274.700000000001), (2285.9000000000001, 43590.599999999999), (40165.199999999997,
21776.799999999999), (9160.5, 6764.71), (772734.0, 74193.5), (25931.0, 50000.0), (163399.0,
5897.4399999999996), (307.19999999999999, 2.86212), (8647.5, 50863.400000000001),
(4.2999999999999998, 5.2272699999999999), (287.80000000000001, 190.85599999999999),
(886.60000000000002, 638.88900000000001), (1002.2, 1.0), (331.69999999999999, 135.416),
(2952.5999999999999, 14112.799999999999), (416.10000000000002, 5522.8400000000001), (249.0,
120.767), (384.5, 15921.6), (61.200000000000003, 56.0976), (644.0, 6969.6999999999998), (508.5,
40.350900000000003), (145.09999999999999, 18.5822), (1176.9000000000001, 10952.4),
(5.7999999999999998, 1.5333300000000001), (2.7999999999999998, 1.0), (7.0999999999999996, 1.0),
(120.7, 18.596), (3492.0999999999999, 57411.599999999999), (164.80000000000001,
9.4171499999999995), (16443.0, 50000.0), (13.300000000000001, 7805.2700000000004),
(4.0999999999999996, 1.0), (340.89999999999998, 176.923), (196.59999999999999,
10.211600000000001), (5.0, 3.5561799999999999), (1386.2, 175.114), (4529.8000000000002,
1315.4100000000001), (4056.8000000000002, 3924.46)]
auc_cutoff = 50

ax = subplot(111)
# Axis scale must be set prior to declaring the Formatter
# If it is not the Formatter will use the default log labels for ticks.
ax.set_xscale('log')
ax.set_yscale('log')

formatter = FuncFormatter(log10Product)
ax.xaxis.set_major_formatter(formatter)
ax.yaxis.set_major_formatter(formatter)

tp_prediction_experiment = [[x[0], x[1]] for x in prediction_experiment if x[1] < auc_cutoff]
tn_prediction_experiment = [[x[0], x[1]] for x in prediction_experiment if x[1] > auc_cutoff]

ax.scatter( [x[1] for x in tn_prediction_experiment], [x[0] for x in tn_prediction_experiment],
s=8, c='r', marker='s', faceted=False)
ax.scatter( [x[1] for x in tp_prediction_experiment], [x[0] for x in tp_prediction_experiment],
s=8, c='b', marker='s', faceted=False)

# set the x and y limits of the plot to the upward nearest exact log decade of the max vertice
max_xlim = roundUpLogDecade(max([x[1] for x in prediction_experiment]))
max_ylim = roundUpLogDecade(max([x[0] for x in prediction_experiment]))

# Must add 1 to allow the last decades label to be shown
print max_xlim
print max_ylim

ax.set_xlim(1e-1, max_xlim+1)
ax.set_ylim(1e-1, max_ylim+1)
grid(True)
xlabel(r"Experimental IC50 [nM]", fontsize = 12)
ylabel(r"Prediction", fontsize = 12)
show()

···

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com