<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def send_fig(fig,name):
 	""" 	sends figure to frontend 	"""

	imgdata = StringIO.StringIO()
	fig.savefig(imgdata, format='png')
	imgdata.seek(0)  # rewind the data
	uri = 'data:image/png;base64,' + urllib.quote(b64encode(imgdata.buf))
	send_action("update_plot",params={"src":uri, "name":name})