I'm trying to figure out why this command is taking on average over 14 seconds 
to render a drawing of a fairly simple plot.  If anyone has ideas, I'd really 
appreciate some help.

fig = figure(figsize=(12.5,3.75), dpi=80,facecolor = 'y', edgecolor='b')

start_date = "20050710"
start_date += "T000000"
my_dates = list(rrule(DAILY, dtstart=parse(start_date), until=datetime.today()))
formatted_dates = [date2num(parse(start_date))]
for date in my_dates :
    formatted_dates.append(date2num(date))
formatted_dates.append(date2num(datetime.today()))

y_ticks = []
for x in xrange(0,11):
    my_string = str(x*10)+' Percent'
    y_ticks.append(my_string)

yticks(arange(0.0, 1.1, .1), y_ticks)

y_data = rand(len(formatted_dates))

ax = fig.add_subplot(111)
ax.plot_date(formatted_dates, y_data, '-')

labels = ax.get_xticklabels()
setp(labels, rotation=20, fontsize=8)
ax.autoscale_view()

#xlabel('')
#ylabel('')
title('Could put start date and end date here')
grid(True)

canvas = FigureCanvasAgg(fig)

# 90% Run-time
############################################
############################################
canvas.draw()
############################################
############################################

imageSize = canvas.get_width_height()
imageRgb = canvas.tostring_rgb()
pilImage = Image.fromstring("RGB", imageSize, imageRgb)
pilImage.show()

       
---------------------------------
Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. 
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to