I'm just want to get base64 string of plot image(png) from matplotlib in remote ubuntu server by python for serving to web page.
But, it is not working in remote server(ubuntu14.04, python3) like below.
plt.plot(date, created, 'b', label='Created')
plt.plot(date, closed, 'r', label='Closed')
buf = io.BytesIO()
plt.savefig(buf, format='png')
img_base64 = base64.b64encode(buf.getvalue()).decode('utf8')
plt.close()
buf.close()
_tkinter.TclError: no display name and no $DISPLAY environment variable
Please help me...