Hi all, :)

I have done atlast - i used Image::Magick to generate my static - data set -
including curve and a small PERL script will do the reading and plotting of
the points. But, still the annotation is not working on my server and pc :(

#29/12/2005
# [EMAIL PROTECTED]

#!/usr/bin/perl
use Image::Magick;

my $ima = Image::Magick -> new;
$ima -> set(size=>'680 x 450');
$ima->ReadImage('xc:white');
$infile = shift;

#Y - Axiz/
$ima -> Draw (stroke=>'black', primitive=>'line', strokewidth=>'2',
points=>"50,420 50,10");
$yl = 500;
for($y=380;$y>=20;$y-=40)
        {
        $ima -> Draw (stroke=>'red', primitive=>'line', strokewidth=>'3',
points=>"46,$y 54,$y");
        $yp = $y - 13;
        $ima->Annotate(text=>"$yl",x=>'-320', y=>"$yp",font=>'Generic.ttf', 
fill=>'black',gravity=>'North',pointsize=>14);
        $yl += 500;
        }       
#X - Axiz -
$xl = 100;
$ima -> Draw (stroke=>'black', primitive=>'line', strokewidth=>'2',
points=>"50,420 660,420");
for($x=150;$x<=650;$x+=100)
        {
        $ima -> Draw (stroke=>'pink', primitive=>'line', strokewidth=>'3',
points=>"$x,414 $x,424");
        $xlp = $x - 340;
        $ima->Annotate(text=>"$xl",x=>"$xlp", y=>"419",font=>'Generic.ttf', 
fill=>'black',gravity=>'North',pointsize=>14);
        $xl += 100;
        }

#Harmony Calibration Plot - Values from p1
#363 2155.201
$ima -> Draw (stroke=>'gold', primitive=>'line', strokewidth=>'9',
points=>"413,247.6 418,247.6");

#129  701.6
$ima -> Draw (stroke=>'gold', primitive=>'line', strokewidth=>'9',
points=>"179,363.72 184,363.72");

#174 1032.8
$ima -> Draw (stroke=>'gold', primitive=>'line', strokewidth=>'9',
points=>"224,337.36 229,337.36");

#437 2200.002
$ima -> Draw (stroke=>'gold', primitive=>'line', strokewidth=>'9',
points=>"487,244 492,244");

#111 673.9001
$ima -> Draw (stroke=>'gold', primitive=>'line', strokewidth=>'9',
points=>"156,366.16 161,366.16");

#153 764.9001
$ima -> Draw (stroke=>'gold', primitive=>'line', strokewidth=>'9',
points=>"201,354.8 206,354.8");

#183 930.8999
$ima -> Draw (stroke=>'gold',primitive=>'line', strokewidth=>'9',
points=>"233,345.2 238,345.2");

#113 702.9
$ima -> Draw (stroke=>'gold', primitive=>'line', strokewidth=>'9',
points=>"163,363.4 168,363.4");

#124 748.1999
$ima -> Draw (stroke=>'gold', primitive=>'line', strokewidth=>'9',
points=>"174,360.16 179,360.16");

#247 1284.4
$ima -> Draw (stroke=>'gold', primitive=>'line', strokewidth=>'9',
points=>"297,317.28 302,317.28");

#TrendsLine
$ima -> Draw (stroke=>'black', primitive=>'line', strokewidth=>'1',
points=>"50,415 660,160");

# Processing of Input data
open(K,"<$infile");
while (<K>)
        {
        chomp;
        $_ =~ s/^\s+//;
        $_ =~ s/\s+$//;
        ($x,$y) = split(/ /,$_);
        $yp = 420 - ($y / 12.5);
        $x += 50;
        $xp1 = $x - 2;
        $xp2 = $x + 2;
        $ima -> Draw (stroke=>'blue', primitive=>'line', strokewidth=>'9',
points=>"$xp1,$yp  $xp2,$yp");
        }
close K;
# GIF Image Generated
$ima->Write('gif:-');

Thats all -
try the program as program.pl filename>image.gif

If everything fails - Expect magical - miracles !!!
Happy PERL !!!


SK

Reply via email to