I am trying to run a programme which is using PGPLOT.When I call it from browser I get following error message.
--------
%PGPLOT, Unable to read font file: grfont.dat %PGPLOT, Use environment variable PGPLOT_FONT to specify the location of the PGPLOT grfont.dat file. %PGPLOT, PGENV: no graphics device has been selected %PGPLOT, PGBBUF: no graphics device has been selected %PGPLOT, PGMTXT: no graphics device has been selected %PGPLOT, PGMTXT: no graphics device has been selected %PGPLOT, PGMTXT: no graphics device has been selected %PGPLOT, PGEBUF: no graphics device has been selected
----------
grfont.dat file is on on my system under c:\XAMPP\perl\lib and I have set it as enviorment variable PGPLOT_FONT.
Any help will be much appreciated.
Thanks,
7 4100
Maybe you can shed some light on this, but how is this a Perl problem? If you are coding something to run it using Perl, then you need to please post your code here. If not, I will have to move this question to a more suitable category.
Regards,
Jeff
hanks for your response.Sorry if I didn't explain it properly.Yes I am using a perl script.
In fact it works fine from the command line but only when I call it from browser.I get this error.
Even I tried to add the enviorment variable to code itself
$ENV{PGPLOT_FONT} ||= 'c:\XAMPP\perl\lib\grfont.dat';
But it still cannot pick it.
if you need more info.Please let me know.
Thanks,
Bilal
We are going to have to see your script if we are going to help you. Even then there are no guarantees, but at least we will have a better idea of what you are trying to do.
Regards,
Jeff
@numberwhun -
#!"C:\xampp\perl\bin\perl.exe" -w
-
-
# TRG: Perl Script to plot graph using PGPLOT
-
# the output is sent to a UUID named file in WWW/tmp directory
-
-
-
use strict;
-
use Time::Local;
-
use Time::Piece;
-
use Time::Piece::MySQL;
-
use DBI;
-
use Data::Dumper;
-
use Switch;
-
use POSIX;
-
use CGI qw(:standard);
-
use CGI::Carp qw(fatalsToBrowser);
-
use PGPLOT;
-
use Algorithm::CurveFit;
-
use strict; use warnings;
-
-
print "Content-type: text/html\n\n";
-
print Dumper(\%ENV);
-
$ENV{PGPLOT_FONT} ||= 'c:\XAMPP\perl\lib\grfont.dat';
-
my $database = 'prism';
-
my $username = 'prism_user';
-
my $password = 'pr1sm_pass';
-
-
# Default patient to simplify rapid testing
-
my $patient_forename = 'random';
-
my $patient_surname = 'test';
-
-
-
# Retrieve graph types and time limits from GET ?
-
my $start_time = param("from");
-
my $end_time = param("to");
-
my $graph_type = param("type"); # day week or time
-
my $patient_id = param("pid");
-
# Diagnostic output
-
print "Graph for pid=${patient_id}, type=${graph_type}, from=${start_time}, to=${end_time} <br>\n";
-
# connect to databse
-
my $dbh = DBI->connect(('DBI:mysql:' . $database), $username, $password)
-
|| die "Database Connection Failure: $!";
-
# find patient
-
my $patient;
-
if ($patient_id)
-
{ $patient = get_patient_byid($dbh,$patient_id);}
-
else
-
{ $patient = get_patient_byname($dbh,$patient_forename,$patient_surname); }
-
-
# get reading dates[0] and value[1] as a structure
-
my @readings = get_readings($dbh,$patient, $start_time,$end_time);
-
my @limits = get_current_limits($dbh,$patient);
-
-
# done with the database
-
$dbh->disconnect();
-
# GPAPH USING PGPLOT
-
-
my $xmin = 0;
-
my $xmax = 1;
-
my $ymin = 0;
-
my $ymax = 32; # TRG 26Aug08 changed to 32
-
my $xlabel = 'X';
-
-
# Set X-axis range and labelling appropriate to graph_type
-
switch ($graph_type) {
-
case "day" { $xmin=6; $xmax=24+6; $xlabel='hours in day';}
-
case "week" { $xmin=1; $xmax=8; $xlabel='days of week';}
-
case "time" { $xmin=$start_time; $xmax=$end_time; $xlabel='date-time'; }
-
else { print "ERROR: Unrecognised graph type\n" }
-
}
-
# Initialise PGPLOT
-
-
#pgbegin(0,"${output_path}${output_file}/PNG",1,1); # 1,1 is number of x,y subplots
-
-
pgenv($xmin,$xmax,$ymin,$ymax,0,0); # final number -1 for no axes..
-
-
pglabel($xlabel,'Glucose, mmol/L',$graph_type);
-
-
-
# ----------------------------------------------------------------------
-
-
-
# Search for patient-ref given forename and surname
-
sub get_patient_byname { # (handle,forename,surname) returns patient-ref
-
my $dbh = shift;
-
my $forename = shift;
-
my $surname = shift;
-
-
my $query = $dbh->prepare(
-
"SELECT * FROM patients WHERE p_forename = ? AND p_surname = ?");
-
-
print "Looking for patient by name ($forename $surname)\n";
-
$query->execute($forename,$surname);
-
my $patient = $query->fetchrow_hashref()
-
|| die "coulnt find patient\n";
-
$query->finish();
-
return $patient;
-
}
-
-
-
# Search for patient-ref given pid
-
sub get_patient_byid { # (handle,pid) returns patient-ref
-
my $dbh = shift;
-
my $pid = shift;
-
-
my $query = $dbh->prepare(
-
"SELECT * FROM patients WHERE pid = ?");
-
-
#print "Looking for patient by ID($pid)\n";
-
$query->execute($pid);
-
my $patient = $query->fetchrow_hashref()
-
|| die "coulnt find patient\n";
-
$query->finish();
-
return $patient;
-
}
-
-
-
-
-
# get patients readings within date range as (dtg,value)
-
sub get_readings { # (handle,patient-ref,start_time,end_time) returns readings
-
my $dbh = shift;
-
my $patient = shift;
-
my $start_time = gmtime(shift);
-
my $end_time = gmtime(shift);
-
my $pid = $patient->{'pid'};
-
my (@results) = ();
-
-
my $query = $dbh->prepare(
-
# "SELECT meter_dtg, value FROM readings ".
-
# "WHERE pid = ? AND meter_dtg>=? AND meter_dtg <=?");
-
-
"SELECT meter_dtg,value,lo_val,hi_val,lo_avg,hi_avg FROM readings,limits ".
-
"WHERE readings.lid = limits.lid AND readings.pid = ? AND meter_dtg>=? AND meter_dtg <=? ".
-
"ORDER BY meter_dtg");
-
# note that there are two PID fields
-
-
$query->execute($pid,$start_time->mysql_datetime,$end_time->mysql_datetime);
-
while (my @ary = $query->fetchrow_array())
-
{
-
push(@results, [@ary]); # store the reference
-
}
-
$query->finish();
-
-
#print Dumper(@results);
-
return @results;
-
}
-
-
-
sub get_current_limits { # (handle,patient-ref) returns current limits for patient
-
my $dbh = shift;
-
my $patient = shift;
-
my $pid = $patient->{'pid'};
-
my (@results) = ();
-
-
my $query = $dbh->prepare(
-
"SELECT lo_val,hi_val,lo_avg,hi_avg FROM limits,patients ".
-
"WHERE limits.lid=patients.current_lid AND patients.pid=?");
-
-
$query->execute($pid);
-
while (my @ary = $query->fetchrow_array())
-
{
-
push(@results, [@ary]); # store the reference
-
}
-
$query->finish();
-
-
#print "<<<<<". Dumper(@results) .">>>>>>><br>\n";
-
return @results;
-
}
-
@bamusic You will probably notice that I have deleted the thread you created today. Creating a new thread with the same content is called creating a duplicate thread. If you are not getting a reply, then keep the thread active and ask if anyone has a suggestion.
I took a look briefly, but am not sure why you are having the issues you are. Hopefully someone will respond to you, but please refrain from creating duplicate threads as it makes more work for those of us maintaining the site, who have to clean it up.
Regards,
Jeff
@numberwhun
Sorry about that.I actually was posting few forums and probably lost the site.
You probably have this fixed by now, and I'm by no means an expert, but I've noticed you've commented out your pgbegin line. There is no device set for pgplot to know where to plot to.
Line 73 #pgbegin(0,"${output_path}${output_file}/PNG",1,1); # 1,1 is number of x,y subplots
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Dennis Hore |
last post by:
I'm trying to install Nick Patavalis' ppgplot package on Mac OS X 10.3
with python 2.3. I first sent this message to Nick, but he said he
doesn't have any experience with the Mac platform.
...
|
by: cm012b5105 |
last post by:
Hello i want to put an interactive text programme in to a graphical box
this is a small section of my text programme
s = raw_input ("Hello whats your name? ")
if s=='melvyn':
print "your my...
|
by: melledge |
last post by:
Full Programme for XTech 2005 Announced
Premier European XML Industry Event Expands Focus to "XML, the Web and
Beyond";
Co-hosted by the Mozilla Foundation,W3C, and OASIS, Presenters Include...
|
by: Mark J. McGinty |
last post by:
Greets,
Part of the content of one of our web pages uses wingdings and Chr(239)
through Chr(242) (which are little arrow outlines, though that's not really
important.)
It worked just fine in...
|
by: Bart Schelkens |
last post by:
Hi,
I'm writing an ASP.Net programme (using VB.Net)
When I press F5 to run and debug, i get the message :
Error while trying to run project. Would you like to disable future attempts
to debug...
|
by: Randall Parker |
last post by:
Some questions on forms authentication:
1) Can one do one's own checking of username and password and totally bypass calling
FormsAuthentication.Authenticate?
2) does the "new...
|
by: Martin Jørgensen |
last post by:
Hi,
I'm trying to move a matlab program into c language. For those who knows
matlab, this is the line I want to program in c:
hx(1:nx,1:ny) = 0; % nx=10, ny=10
It works on a 2-dimensional...
|
by: AppleBag |
last post by:
I'm having the worst time trying to login to myspace through code. Can
someone tell me how to do this? Please try it yourself before replying,
only because I have asked this a couple of times in...
|
by: arnuld |
last post by:
i compiled the "hello world" programme from K&R2:
#include<stdio.h>
int main() {
printf("hello world\n");
}
|
by: chang |
last post by:
Hi ALL,
I am working in C from past few months. Still now i can't
figure out who is called main() in 'C' programme?
Main() is a function from that we can call our sunroutines but someone
has to...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |