I'm a bit of newbie at this and am trying to create a scatter chart with custom bubble sizes and colours. The chart displays fine but how do I get a legend saying what the colours refer to. This is as far as I've got:
inc = []
out = []
bal = []
col = []
fig=Figure()
ax=fig.add_subplot(111)
inc = (30000,20000,70000)
out = (80000,30000,40000)
bal = (12000,10000,6000)
col = (1,2,3)
leg = ('proj1','proj2','proj3')
ax.scatter(inc, out, s=bal, c=col)
ax.axis([0, 100000, 0, 100000])
ax.set_xlabel('income', fontsize=20)
ax.set_ylabel('Expenditure', fontsize=20)
ax.set_title('Project FInancial Positions %s' % dt)
ax.grid(True)
canvas=FigureCanvas(fig)
response=HttpResponse(content_type='image/png')
canvas.print_png(response)
This thread was helpful, but couldn't get it to solve my problem: http://stackoverflow.com/questions/872397/matplotlib-legend-not-displayed-properly