#!/usr/bin/perl -w
use strict;
use Chart::Gnuplot;
# Initiate the chart object
my $chart = Chart::Gnuplot->new(
output => "plotStyle_1.png",
);
# A line
my $lines = Chart::Gnuplot::DataSet->new(
func => "cos(x)",
style => "lines",
title => "Plot a line",
);
# Points
my $points = Chart::Gnuplot::DataSet->new(
func => "sin(x)",
style => "points",
title => "Plot points",
);
# Points on a line
my $linespoints = Chart::Gnuplot::DataSet->new(
func => "-atan(x)",
style => "linespoints",
title => "Plot points on a line",
);
# Plot the graph
$chart->plot2d($lines, $points, $linespoints);