|Just trying the examples without modifications will not work|
1) Header type
In the examples, the header is set to "image/jpeg"
Always an error message appeared.
Switching to text/html immediately made the sript running
2) Remove path info in file names
3) Be careful: the graph is written to the disk