* perlでグラフがかけない!! [#o5d48199] -ページ: [[質問箱]] -投稿者: [[ひまわり]] -状態: 提案 -投稿日: ** メッセージ [#k462780c] #!/usr/local/bin/perl print "Content-type: image/png\n\n"; use CGI; use GD::Graph::lines; @data = ( [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep" ], [ sort { $b <=> $a } (9, 3, 5, 6, 3, 1.5, -1.5, -2, -3.5)], [4, 3, 5, 6, 3, 1.5, -1, -3, -4], [ sort { $a <=> $b } (9, 3, 5, 6, 3, 1.5, -1.5, -2, -3.5)], [ reverse(9, 3, 5, 6, 3, 1.5, -1.5, -2, -3.5)], ); $my_graph = new GD::Graph::lines(500,300); $my_graph->set( line_types => [ 1, 2, 3, 4 ], line_type_scale => 8, line_width => 3, ); $my_graph->set_legend( '1', '2', '3', '4' ); open( IMG , " > file.png") || die $!; binmode IMG; print IMG $my_graph -> plot(\@data) -> png; close(IMG); ---- -私の環境ではopen( IMG , ">file.png") || die $!; とファイル名周りの余分な空白を除いただけで動いたよ -- [[Zazel]] &new{2004-01-06 (火) 21:16:55}; #comment #comment_nospam