adding the possibility to specify the output type of the generated figur...

@jpihl check it out and merge at your discretion.