my $format = $my_graph->export_format; print header("image/$format"); binmode STDOUT; print $my_graph->plot(\@data)->$format();