File: plotStyle_9.pl

package info (click to toggle)
libchart-gnuplot-perl 0.23-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 944 kB
  • sloc: perl: 4,862; makefile: 113
file content (26 lines) | stat: -rwxr-xr-x 664 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl -w
use strict;
use Chart::Gnuplot;

#------------------------------------
# Demonstrate setting error line styles
#------------------------------------

# Initiate the chart object
my $chart = Chart::Gnuplot->new(
    output => 'gallery/plotStyle_9.png',
);

# - Data can be specified by xdata and ydata, or points
# - Styles include xerrorlines, yerrorlines and xyerrorlines
my @x = (1, 2, 3, 4, 5, 6);
my @y = (-2, -1, 0, 1, 2, 3);
my @err = (0.5, 0.4, 0.3, 0.1, 0.5, 0.2);
my $xerrorlines = Chart::Gnuplot::DataSet->new(
    xdata => [\@x, \@err],
    ydata => \@y,
    style => 'xerrorlines',
);

# Plot the graph
$chart->plot2d($xerrorlines);