The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Xi Graphics, Inc. Releases Wall Display Graphics Support Software - PR Newswire (pres iBot UNIX and Linux RSS News 0 07-17-2007 08:30 AM
Print a Graphics File using a SCO Unix Command Steve_93630 UNIX for Dummies Questions & Answers 0 12-06-2006 06:48 PM
sed not outputting last line of input file 2reperry Shell Programming and Scripting 3 12-16-2005 12:51 PM
PHP Outputting finite amount of lines from a file pondlife Shell Programming and Scripting 1 10-26-2005 12:44 PM
Merge Graphics with text file schaganti Windows & DOS: Issues & Discussions 6 11-08-2004 09:41 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-14-2008
JamesGoh JamesGoh is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 89
Perl GD::Graph and outputting to a graphics file

To successfully export a perl GD::Graph object to a graphics file (e.g. a .png file), do you do the following ?


Code:

# Set graph data

$graph->set(....);
$graph->plot(\@graph_data);
open(IMG,'>file.png') or die $!;
binmode IMG;
print IMG $graph->png;
close IMG;

Reason Im asking is because the resulting .png file cannot be opened (even with the .png viewer packages being installed)

regards
James
  #2 (permalink)  
Old 12-15-2008
JamesGoh JamesGoh is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 89
I managed to solve the problem.

It was a case of using the 'require' keyword to include an external perl script and invoking the method contained within it in order to properly create a graphics file.

In my case Im using GDGraph-1.44_01 package, so you MUST include the following in your perl script at all times


Code:

# At the start

require '/complete path name of save.pl/save.pl


# When you want to export to a graphics file

save_chart($graph,$graph_title);

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0