Gnuplot Mode Help
Name:Gnuplot Mode
Version:2.4
Last update:2019-10-17 13:28:57





Introduction

Gnuplot is a command-line driven interactive function plotting utility for UNIX, Mac OS X, MSDOS, and VMS platforms. The software is copyrighted but freely distributed (i.e., you don't have to pay for it). It was originally intended as a graphical program which would allow scientists and students to visualize mathematical functions and data.
See http://gnuplot.sourceforge.net/
This mode provides syntax coloring, keywords completion, file marking and editing facilities. A Shift-Command-Double-Click on a keyword will display Gnuplot's built-in help about it. The mode also lets you process gnuplot commands or scripts and run gnuplot sessions from Alpha.
For the processing commands to work properly, you need to have a gnuplot command installed on your machine. You also need the AquaTerm application in order to display the graphs generated by gnuplot. Gnuplot (and AquaTerm) can be easily installed on Mac OS X using a packaging tool such as MacPorts, or Fink, or Homebrew.
If you only need to edit a gnuplot file, then none of the previously mentionned tools are required.

Console

Gnuplot mode also serves as a front end for the gnuplot command. Alpha provides its own Gnuplot console. You can display Alpha's Gnuplot console with Command-K or using the Console menu item in the Gnuplot menu: this establishes a pipe connection with a gnuplot interpreter. You can execute any gnuplot command in this console and see the result printed out as in any terminal window. As long as the console remains opened, the commands are executed by the same gnuplot interpreter.
To launch the console without necessarily being in Gnuplot mode, you can also activate the Console Launcher package (from Alpha ↣ Global Settings ↣ Features). This inserts a Consoles submenu in the Tools menu. Then select Gnuplot from this submenu.
Here is an example:
Welcome to Alpha's Gnuplot shell.
gnuplot> set yrange [-1.1 : 1.1]
gnuplot> set ytics -1, 1.0 / 10, 1
gnuplot> set title "Functions sine and cosine"
gnuplot> plot cos(x),sin(x)
gnuplot> 
Of course, for this to work, you must have installed the gnuplot utility on your machine. It is not present by default on Mac OS X.
The last command will display the following image with the AquaTerm program:
Plot sine and cosine

Completions

The mode supports electric keywords. For instance, type the word ifelse (without the quotes), then hit the completion key (which is by default control-tab). The following template is inserted at the cursor's position:
if (•) •; else •
•
Other electric keywords are (try them!): Similarly, if you type the beginning of a Gnuplot keyword or command, then hit the completion key, the name is automatically completed. If there are several possibilities, a listpick dialog lets you choose the one you want. For instance, type 'xy' (without the quotes), then hit the completion key. The mode displays a listpick dialog with the following suggestions: xyerrorbars, xyerrorlines, xyplane.
Click on this Gnuplot Example link for an example syntax file.

Menu Items

The items of the Insert Functions submenus (Maths, Strings, Other) let you insert a template for all the Gnuplot built-in functions. In order to navigate to the next bullet in a template, use the navigation key: by default this is the Tab key but you can set another one via the Alpha ↣ Global Setup ↣ Keyboard Shortcuts ↣ Special Keys dialog.
The Get Help… menu item is an interface to Gnuplot's help command. A dialog asks you the command about which you want help (for instance plot, set arrow). Gnuplot's internal help is then displayed in the console.
The Save Settings… menu item is an interface to Gnuplot's save command. A dialog asks you which kind of settings you want to save (set, fun, var, term or all). Then a navigation dialog asks you where to save the settings.

Preferences

You can modify some of the GPLT mode behaviour by selecting the menu item Alpha ↣ GPLT Mode Setup ↣ Mode Preferences. Click here to display the GPLT Mode Preferences

Known problems

Please report any problem or bug you encounter in Alpha's Bug Tracker. Comments, suggestions, and bug reports are always welcome, feel free to contact the current maintainer of this package.

License and Disclaimer

Original Author: Jeff Schindall.
Copyright (c) 1995-2019, Jeff Schindall and Contributors.
Contributors: Vince Darley, Craig Barton Upright, Bernard Desgraupes.
All rights reserved.
The Gnuplot Mode package is free software and distributed under the terms of the new BSD license:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JEFF SCHINDALL OR THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.