|
From: Jeffrey M. <jm...@gm...> - 2012-02-20 23:36:46
|
I'm using Flask to output graphs to a web service, and when I move
from a standalone script to the web service I'm getting weird
behavior.
In gantt_test.py, I do this:
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
[...]
canvas = FigureCanvas(fig)
fig.savefig("gantt.png")
And it looks nice.
In the web service, the only difference is:
canvas = FigureCanvas(fig)
x = StringIO()
canvas.print_png(x, facecolor="w", edgecolor="w", dpi=100)
And it has a grey background, weirder margins, and seems to be stuck at dpi=80.
What am I missing? The version of python & matplotlib are the same
between machines. One is Windows 7, the other 2K3.
-Jeff
|