BUG: use agg since there is no display when calling from the server