From: Michael H. <mh...@us...> - 2008-06-09 20:35:32
|
I'm having a problem with the bbox keyword to the text() function. The code below, for me, results in one postscript file that looks fine, but the PNG file has letters outside of the bounding box for most of the words I plot. I'm using matplotlib '0.98pre' on Mac OS X. import matplotlib matplotlib.use('agg') from pylab import * x = array([6,7,8,9,10]) y = array([6,7,8,9,10]) fig = figure() plot(x,y,'rx') hold('on') fontdict2 = {'fontweight':'light', 'color': 'k', 'fontsize':9} words = ['Hi','Goodbye','What''s this','Aloha','So long, farewell'] for i in range(0,len(x)): tx = x[i] ty = y[i] word = words[i] text(tx,ty,word,fontdict2,bbox={'facecolor':'w'}) savefig('textplot.eps') savefig('textplot.png') close(fig) -- ------------------------------------------------------ Michael Hearne mh...@us... (303) 273-8620 USGS National Earthquake Information Center 1711 Illinois St. Golden CO 80401 Senior Software Engineer Synergetics, Inc. ------------------------------------------------------ |