Ghostscript is required by ImageMagick to interpret Postscript and PDF image files." And Ghostscript is another 14.9MB and not available in a portable form.
Oh wait! "gswin32c.exe is installed on your computer when you install Ghostscript.
( gnuplot has online documentation, right? Well, there's a 2MB PDF you can download.
I may just bite the bullet and figure out how to pass commands directly to gnuplot. To fix this, you need to download and install ImageMagick (which runs to a whopping 41.9MB and there's no portable 64-bit version) and set $chart->convert("C:\.\convert.exe") so that it knows where to find the program.Ĭonvert.exe: Postscript delegate failed `C.Tempp_PRwRJnYzplot.tmp': No such file or directory error/ps.c/ReadPSImage/806. Last time I checked, gnuplot was perfectly capable of outputting PNGs. You would be forgiven for not knowing that this program was ever being invoked, of course. Under Microsoft Windows XP, why do I get an error like Invalid Parameter - 432x432 This means that ImageMagick wasnt properly installed. The "-rotate 90" parameter is meaningless to Windows convert, and it is Windows convert which emits the error. Now you can see where that absolutely maddening and inscrutable error, "Invalid Parameter - 90", comes from. On Windows, of course, convert is a command for converting FAT and FAT32 volumes to NTFS. On Linux, convert is the image conversion program which comes with ImageMagick. My $cmd = "$convert -rotate 90 $temp $temp".".$imgfmt 2>&1" It just blindly calls convert at the command line and assumes that this will work: Chart::Gnuplot doesn't go out of its way to tell you if ImageMagick isn't installed. What I didn't realise until I read the documentation was that by default this module outputs a PS file, then converts that PS file to the file format you want (i.e., PNG) using a third-party image manipulation program called ImageMagick. Of course I downloaded gnuplot before trying this, and set up the command line so that the module would find it successfully when called at the command line. Since GD::Graph is the graphing package for Perl, this is a pretty glaring shortcoming. That makes it impossible to do an XY scatter plot in GD::Graph. It just casts the numerical data to a string and evenly spaces the strings.Īnd no, the workaround mentioned in the documentation doesn't work. This is despite the facts that GD::Graph has no problem whatsoever with numerical Y-axis data, and that GD::Graph has no problem whatsoever with you submitting numerical data on the X-axis in the first place. It's right here in the documentation that data on the X-axis in any GD::Graph graph will always be evenly spaced. Here are two cautionary notes: GD::Graph can't do numerical X-axes I started something that I hoped would be a very small and quick project, but it looks like it's close to impossible to draw a decent XY scatter plot in Perl.