gnuplot is a command-line and GUI program that can generate two- and three-dimensional plots of functions, data, and data fits. The program runs on all major computers and operating systems (Linux, Unix, Microsoft Windows, macOS, FreeDOS, and many others).[3]Originally released in 1986, its listed authors are Thomas Williams, Colin Kelley, Russell Lang, Dave Kotz, John Campbell, Gershon Elber, Alexander Woo "and many others."[4] Despite its name, this software is not part of the GNU Project.
gnuplot can produce output directly on screen, or in many formats of graphics files, including Portable Network Graphics (PNG), Encapsulated PostScript (EPS), Scalable Vector Graphics (SVG), JPEG and many others. It is also capable of producing LaTeX code that can be included directly in LaTeX documents, making use of LaTeX's fonts and powerful formula notation abilities. The program can be used both interactively and in batch mode using scripts.[5]
gnuplot can read data in multiple formats, including ability to read data on the fly generated by other programs (piping), create multiple plots on one image, do 2D, 3D, contour plots, parametric equations, supports various linear and non-linear coordinate systems, projections, geographic and time data reading and presentation, box plots of various forms, histograms, labels, and other custom elements on the plot, including shapes, text and images, that can be set manually, computed by script or automatically from input data.
Despite gnuplot's name, it is not named after, part of or related to the GNU Project, nor does it use the GNU General Public License. It was named as part of a compromise by the original authors, punning on gnu (the animal) and newplot (a planned name that was discarded due to already being used).[9]
Official source code to gnuplot is freely redistributable, but modified versions thereof are not. The gnuplot license allows instead distribution of patches against official releases, optionally accompanied by officially released source code. Binaries may be distributed along with the unmodified source code and any patches applied thereto. Contact information must be supplied with derived works for technical support for the modified software.[2]
Despite this restriction, gnuplot is accepted and used by many GNU packages and is widely included in Linux distributions including the stricter ones such as Debian and Fedora. The OSI Open Source Definition and the Debian Free Software Guidelines specifically allow for restrictions on distribution of modified source code, given explicit permission to distribute both patches and source code.
I've started on a project graphing Tomcat logs using gnuplot-py, specifically correlating particular requests with memory allocation and garbage collection. What is the collective wisdom on gnuplot-py vs Matplotlib for Python graphing. Are there better graphing libraries out there I haven't heard of?
I know this post is old and answered but I was passing by and wanted to put my two cents. Here is my conclusion: if you have a not-so-big data set, you should use Matplotlib. It's easier and looks better. However, if you really need performance, you could use Gnuplot. I've added some code to test it out on your machine and see for yourself if it makes a real difference (this is not a real performance benchmark but should give a first idea).
matplotlib has pretty good documentation, and seems to be quite stable. The plots it produces are beautiful - "publication quality" for sure. Due to the good documentation and the amount of example code available online, it's easy to learn and use, and I don't think you'll have much trouble translating gnuplot code to it. After all, matplotlib is being used by scientists to plot data and prepare reports - so it includes everything one needs.
After using GNUplot (with my own Python wrapper) for a long time (and really not liking the 80s-looking output), I just started having a look at matplotlib. I must say I like it very much, the output looks really nice and the docs are high quality and extensive (although that also goes for GNUplot). The one thing I spent ages looking for in the matplotlib docs is how to write to an image file rather than to the screen! Luckily this page explains it pretty well: _without_gui.html
I have been working with LaTeX, under TeXMaker (latest version 3.2.2) for several months, and recently added PGF/TikZ capability. On that occasion I feared there would be problems as I really have very little understanding of how the various applications hang together, or even where to find them. But no, once I found where TeXMaker resided I simply added the PGF files as a subdirectory and to my complete surprise, it all worked. Similar success was had with adding tikz-3dplot capability.
Recently, working my way through the TikZ manual I wanted to experiment with gnuplot, and all hell broke loose. I am even unable to find what type or version of LaTeX I am working with, i.e. cannot find executables. I know I have MiKTeX 2.9 loaded as I recall pulling it off the net, but if this is the variant of LaTeX my TeXMaker is working with I cannot tell. The one thing I do find is texmaker.exe, everything else is turning into a complete mystery. Without a doubt I am coming across as a complete air head, but my main interest lies in mathematics, but realize I need to invest effort to make the most of LaTeX and its graphic capabilities as a tool.
First, you need to install gnuplot. The binary I used was taken from this page. When installing it, the only change from the default I made when following the installer was to select "Add application directory to your PATH environment variable." This may not be necessary, but seemed like a good idea.
Next you need to tell Texmaker that it's ok for pdflatex to call external programs. Assuming that you use pdflatex as your typesetter, then you only need to add the --enable-write18 option to the command. To do this, in Texmaker go to Options->configure Texmaker, and add --enable-write18 to the options for the PdfLaTeX command. See the highlighted text in the image below:
Windows 10. Sublime Text runs in a Git bash. Here is the same attempt made in a Terminus running first a bash (which can find gnuplot), then julia, which cannot find the executable apparently.
image775895 58.8 KB
There is one slight problem though. I use TikZ wich sometimes uses gnuplot to create it's plots. One would think that running TeXShop alone is enough (TeXShop should call gnuplot) but it isn't for me.
I thought this was normal, until I discorvered it wasn't by using another package that also needs to call an external program (minted, which needs pygmentize and/or python). This package works normally from my TeXShop and this got me thinking: should calling gnuplot from TeXShop work just as well?
Start a simple session with cabal repl.If not already loaded, call :module Graphics.Gnuplot.Simplein order to load Graphics.Gnuplot.Simplewhich is ready for use in GHCi.It does not address all fancy gnuplot featuresin order to stay simple.For more sophisticated plots,especially batch generated graphics,I recommend Graphics.Gnuplot.Advanced.This module contains also an overviewof the hierarchy of objects.
org-babel-gnuplot allows gnuplot code to be executed directly fromwithin embedded code blocks in Org-mode documents. These code blockscan plot functions, graph data from tables stored in the documents,and can include output as embedded graphics when the document isexported.
This file may be downloaded here: org-babel-gnuplot.org. The imagelinks are to the images online on Worg, but running the code blockswill produce matching images in the same directory as the .org file.
It should be mentioned that one can also use Org-mode's org-plot as analternative to babel. Instructions already exist on Worg forthis.2 The .org file used to create the org-plot Worg entry islinked in the Introduction on that page and can be very helpful ingetting a feel for using gnuplot by using the #+PLOT header above atable. This page, in contrast, is about using gnuplot in it's "native"form.
To do this, babel support for the gnuplot language must beenabled. Versions of Org-mode prior to 7.01 required enabling bothgeneral babel support as well as specific language support like this:
To run gnuplot and produce a resultant graph (or to produce any resultfrom babel code blocks), simply move one's cursor anywhere in the codeblock and press C-c C-c (Ctrl+C followed by Ctrl+C) and type "yes"in the minibuffer when asked about executing the code. It's thatsimple!
Unfortunately, there seems to be an issue with getting gnuplot-modeworking properly with Org-mode on Windows machines. Attempts to useBabel for gnuplot code blocks or the org-plot method both seem tofail. Discussion is taking place on how to resolve this issue.4As of Aug/Sept 2010, Bruce Ravel, the creator of gnuplot-mode, hasindicated willingness to work with a mailing list member to identifythe potential source of the issue.
Babel block headers are used to pass various arguments to control theresults of the executed code. The complete list of header argumentsis covered in the Org-mode manual; for now, some options frequently used forgnuplot are:5
As stated earlier, the full gnuplot documentation can and should beconsulted as the official reference, but it might be helpful to layout some common syntax here as a quick reference. Any of the commandstyped in code font below should be assumed to reside in a babelcode block (between #+begin_src gnuplot and #+end_src).
Tic marks are set with the method "start,increment[,end]." Start isthe beginning tic value, increment sets how far apart the tics are,the the optional end specifies a stopping value. If no end is given,the tics will carrry on by the increment value until the max x/y valueis reached. Here are some examples:
Named tics can also be used. Two values are provided, a numericalvalue (where on the given axis the tic should be placed) and a name inquotes to indicate what word should be placed at the tic instead of thenumerical value. This method allows for words instead of numbers to beused (which has many uses) as well as for complete control over ticmark placement.
795a8134c1