Hello to everyone,
first of all, many thanks to all that have contributed to the development of
gnu plotutils, libplot and related tools built on them.
I use it for science data analysis and processing in academy jobs
(mostly space science research and tutoring in PhD courses).
I just done some maintenance work on the plotutils sources, so
i want to ask you if this can be helpful for the plotutils users community.
Details:
I faced some issues in using gnu plotutils version 2.6 (distributed in 2009)
mostly on using it on MS Windows and MacOS, i am a Linux user but
most of my colleagues and students use that proprietary closed source OS instead.
I recompiled correctly plotutils from source on MicroSoft Windows
using mingw c/c++ compiler in msys2 compatibility environment (and also cross-compiling on Linux),
but i faced errors using graph exe for plotting on png and gif terminal redirecting
stdout to file from the shell (this only in the MS Windows build).
I've also seen that there where a compilation error also on Linux
for the source file z_write.c of libplot
due to changes in the libpng API , infact new libpng version we have
png_jmpbuf() instead of (png_ptr)->jmpbuf
corrected this, i've seen there could be the need to implement
some error handling calls in case of error on the png output creation.
I don't know how have been compiled the plutitls binaries of gnu plotutils
version 2.6 on Linux, since they give error on compiling z_write.c if
you don't comment or change the calls to (png_ptr)->jmpbuf
i put the debian/ubuntu maintainer in copy also.
It is true that there is a GnuWin32 binary version 2.4.1 of plotutils
that works correctly, but for my projects i prefer always having the possibility
to compile from source, so i added a switch to the program graph
for saving png directly on file, instead of redirecting stdout on somefile.png.
In this way, even with an error on the png created on stdout , you have
the possibility to save the image plot on a file with commands like:
graph.exe -T png -o myoutfile.png somepoints.ssv
on MS win build, but can be used also on unix builds
graph -T png -o myoutfile.png somepoints.ssv
I don't expect to build soon GNU plotutils on MS win with
Xorg support, i think it can be done compiling with mingw,
compiling Xorg libraries and using Xming but at the moment
i don't have time to do it easily.
On MS win instead is easy to plot on the postscript terminal
and then viewing with a postscript viewer, that can be
ghostscript (gswin32.exe) or okular , okular can read also from stdin,
in msys2 bash shell on win this is easy:
graph.exe -T ps somepoints.ssv | okular -
this made me think about the reason to put as default terminal the GNU metafile format,
why don't put postscript as default terminal in graph?
It's just a question to understand, perhaps there are many reasons to maintain gnu metafile
as default output terminal i don't know.
I know that one can always use -T ps and/or use plot program to
convert to postscript or any other terminal/format , but i have the feeling
that first time user and students they just want to do a simple 2D plot, so
they could find easier just to:
graph.exe somepoints.ssv | somepsviewer -
or on unix/linux/MacOS
graph somepoints.ssv | somepsviewer -
or something like that.
or directly with the use of stdin/stdout pipe
or temp file
graph_ps.exe somepoints.ssv
or on unix/linux/MacOS
graph_ps somepoints.ssv
and having the plot popped up on their screen.
for what concern the MacOS build, i have seen
one can download using brew
brew install plotutils
but the binary version that one can download is compiled
without x11 support, so even if one could use XQuartz
you are obliged to recompile plotutils with x support,
perhaps there are other repositories and ways to download
the X11 enabled binaries on Mac, i have not a Mac to test it,
i have just a i386 darwin 8.7 (corresponding to MacOSX tiger v. 10.4) virtual machine, without XDarwin,
so i correctly recompiled plotutils 2.6 on darwin, it works perfectly, including saving png and gif plot files.
I think that i could produce some darwin binaries with x11 support by myself.
also cross-compiling on Linux with Darling compatibility environment,
since on Ubuntu 18.04 last version of Xorg sources