#!/usr/bin/perl -w
use strict;
use Chart::Gnuplot;
# Create the chart object
my $chart = Chart::Gnuplot->new(
output => "labels_10.png",
title => "Composite example",
grid => 'on',
xrange => ["-pi", "pi"],
yrange => [-2, 2],
);
# Add label
$chart->label(
text => "Local minimum",
position => "-pi/2, -1 center",
offset => "0, -1.5",
pointcolor => 'dark-green',
pointtype => 9,
pointsize => 2,
);
$chart->label(
text => "Local maximum",
position => "pi/2, 1 center",
offset => "0, 1",
pointcolor => 'blue',
pointtype => 11,
pointsize => 2,
);
# Data set object
my $dataSet = Chart::Gnuplot::DataSet->new(
func => "sin(x)",
);
# Plot the graph
$chart->plot2d($dataSet);