Re: graf-code



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
# ibiokid@xxxxxxxxx

#!/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


Relevant Pages

  • RE: Passing Data Between Servers
    ... Then your server code is run by placing '|myperlcode -w' into ... >> then just send out to another perl script that would be ... >> Then based on the contents of input lunch another perl ... > something just waiting ...
    (perl.beginners)
  • Re: connect to a remote Postgresql server using DBI
    ... else) to execute queries on the remote database. ... perl script to execute queries on the remote server? ... > See the bottom of this page for client installation ...
    (perl.dbi.users)
  • Email server timing out in email script
    ... I have a perl script running on machine A, ... The email is sent by machine B which is the email server for the domain. ... more than 80 seconds to run, and most of that is timeout. ... Following is the closure part of the log. ...
    (comp.lang.perl)
  • Shhh! Psst! In need of a P..l script
    ... using Tcl's http package ... Isn't Tcl - together with the Wiki - just great? ... Of course I need to run this on my real server - and I won't ... and a Perl script would - in all probability - just work. ...
    (comp.lang.tcl)
  • RE: What is wrong with this script ??
    ... Depending on your server the error could be that the group doesn't exist i.e. on unix you would need to add the groups to /etc/group first. ... I have written a small perl script to create their home directories in the cluster server. ... everything worked fine except for the reason that, it shows up error message indicating that the following messages for example: ... This e-mail may contain confidential information. ...
    (perl.beginners)