#!/usr/bin/perl -w use strict; use Chart::Gnuplot; # Create the chart object my $chart = Chart::Gnuplot->new( output => "polygons_4.png", title => "Draw the polygon on the front layer", ); # Draw a polygon $chart->polygon( vertices => [ " -3, 0.5", "-7, -0.2", {to => "2, -0.4"}, {rto => "0, 0.5"}, ], fill => { pattern => 5, }, layer => 'front', ); # Data set object my $dataSet = Chart::Gnuplot::DataSet->new( func => "sin(x)", ); # Plot the graph $chart->plot2d($dataSet);