TIP GnuPlotPlugin is not installed on Foswiki.org.

GnuPlotPlugin

Allows users to plot data and functions using GnuPlot

Gnuplot is a portable graphing utility. It was originally created to allow scientists and students to visualize mathematical functions and data interactively, but has grown to support many non-interactive uses such as web scripting. It is also used as a plotting engine by third-party applications like Octave. Gnuplot has been supported and under active development since 1986.

See the full documentation of gnuplot itself at http://www.gnuplot.info/documentation.html

Syntax Rules

Images are generated using the %GNUPLOT{<parameters>}% macro. It can either read the plot script from a named section or from a plot script attached to a topic.

Parameter Description Default
"..." name of section in mode="section"; name of attachment in mode="attachment"  
mode="attachment|section" specifies the mode of operation attachment
attachtopic="..." name of the topic where to attach the output of gnuplot current topic
topic="..." name of a topic to read a section (or attachment) from current topic
type="gif|jpeg|png|svg" terminal and file type being generated; note that not all terminal types of gnuplot make sense online png
width="<integer>" width of the image being generated 640
height="<integer>" height of the image being generated 480
size="<integer>x<integer>|dynamic|fixed" geometry of the image being generated; values dynamic and fixed only make sense for type="svg" $width x $height
format="..." format string to render the output image <img src='$url' class='gnuPlotImage' id='gnuplot$name' alt='$name' width='$width' height='$height' />

The format string may use the following variables:

  • $url: url to the image file being created
  • $web: web name where the image has been created
  • $topic: topic name where the image has been attached
  • $file: file name of the image
  • $name: name of the source image
  • $width: width of the image being created
  • $height: height

In addition to the normal gnuplot syntax for plot scripts, they might contain Foswiki makros which are expanded in the context of the topic specified. To reference data files attached to a plot script the variables %ATTACHDIR% and %PUBDIR% are supported to properly determine the location of those.

For example below "Damped Sinus" script looks like this:

set title "Damped Sinus"
set nokey
set xlabel "X Axis Label"
set ylabel "Y Axis Label"
plot '%ATTACHDIR%/DampedSinus.data'

Examples

The following images are examples of plots generated by GnuPlot:

Simple function test

Error: Exception 410: NoImagesDefined `Resize' @ error/Q16HDRI.xs/XS_Image__Magick__Q16HDRI_Mogrify/7840

Multi graphs with errorbars, datafile based

Error: Exception 410: NoImagesDefined `Resize' @ error/Q16HDRI.xs/XS_Image__Magick__Q16HDRI_Mogrify/7840

Map of Denmark, datafile based (data from CIA World Data Bank II)

Error: Exception 410: NoImagesDefined `Resize' @ error/Q16HDRI.xs/XS_Image__Magick__Q16HDRI_Mogrify/7840

Interlocking Tori (3D)

InterlockingTori

Blue Whale (3D), datafile based

BlueWhale

Alternative GnuPlot render sizes, Rosenbrock Function

Error: Exception 410: NoImagesDefined `Resize' @ error/Q16HDRI.xs/XS_Image__Magick__Q16HDRI_Mogrify/7840

Installation

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.

Dependencies

None

Change History

11 Jul 2016: added attachtopic and format parameters (Foswiki:Main.MichaelDaum)
30 Apr 2014: rewrite (Foswiki:Main.MichaelDaum)
30 Apr 2006: Added sandbox security mechanism (Foswiki:Main.SteffenPoulsen)
19 Apr 2006: Fixed anchors, added 3D examples, added png size option (Foswiki:Main.SteffenPoulsen)
17 Apr 2006: Doc update, changed working dir to ATTACHURLPATH (Foswiki:Main.SteffenPoulsen)
27 Jan 2006: Initial version

I Attachment Action Size Date Who Comment
BlueWhale.gnugnu BlueWhale.gnu manage 164 bytes 11 Jul 2016 - 11:38 MichaelDaum  
CIAWorldDataBankIIDenmark.datadata CIAWorldDataBankIIDenmark.data manage 393 K 11 Jul 2016 - 11:39 MichaelDaum Data for <nop>CIAWorldDataBankIIDenmark example
CIAWorldDataBankIIDenmark.gnugnu CIAWorldDataBankIIDenmark.gnu manage 171 bytes 11 Jul 2016 - 11:38 MichaelDaum  
DampedSinus.datadata DampedSinus.data manage 3 K 11 Jul 2016 - 11:39 MichaelDaum Data for <nop>DampedSinusData example
DampedSinus.gnugnu DampedSinus.gnu manage 123 bytes 11 Jul 2016 - 11:37 MichaelDaum  
GnuPlotPlugin.md5md5 GnuPlotPlugin.md5 manage 162 bytes 11 Jul 2016 - 11:41 MichaelDaum  
GnuPlotPlugin.sha1sha1 GnuPlotPlugin.sha1 manage 186 bytes 11 Jul 2016 - 11:41 MichaelDaum  
GnuPlotPlugin.tgztgz GnuPlotPlugin.tgz manage 358 K 11 Jul 2016 - 11:41 MichaelDaum  
GnuPlotPlugin.zipzip GnuPlotPlugin.zip manage 363 K 11 Jul 2016 - 11:40 MichaelDaum  
GnuPlotPlugin_installerEXT GnuPlotPlugin_installer manage 6 K 11 Jul 2016 - 11:41 MichaelDaum  
InterlockingTori.gnugnu InterlockingTori.gnu manage 299 bytes 11 Jul 2016 - 11:37 MichaelDaum  
MultigraphWithErrorbars.datadata MultigraphWithErrorbars.data manage 66 bytes 11 Jul 2016 - 11:39 MichaelDaum Data for <nop>MultigraphWithErrorbarsData example
MultigraphWithErrorbars.gnugnu MultigraphWithErrorbars.gnu manage 450 bytes 11 Jul 2016 - 11:37 MichaelDaum  
RosenbrockFunction.gnugnu RosenbrockFunction.gnu manage 650 bytes 11 Jul 2016 - 11:38 MichaelDaum  
TestInstall.gnugnu TestInstall.gnu manage 52 bytes 11 Jul 2016 - 11:37 MichaelDaum  
gnuplot_0578c5af104caee4c9eefcf4183da270_BlueWhale.svgsvg gnuplot_0578c5af104caee4c9eefcf4183da270_BlueWhale.svg manage 66 K 02 May 2014 - 10:50 MichaelDaum Auto-attached by GnuPlotPlugin
gnuplot_1ac8b9f150aeb9dd95e56ca9e8977a07_CIAWorldDataBankIIDenmark.svgsvg gnuplot_1ac8b9f150aeb9dd95e56ca9e8977a07_CIAWorldDataBankIIDenmark.svg manage 350 K 02 May 2014 - 10:50 MichaelDaum Auto-attached by GnuPlotPlugin
gnuplot_26c785a639935a588e205850a8744f76_InterlockingTori.svgsvg gnuplot_26c785a639935a588e205850a8744f76_InterlockingTori.svg manage 82 K 02 May 2014 - 10:50 MichaelDaum Auto-attached by GnuPlotPlugin
gnuplot_56c40163966ced3994a99fc1f060f6e1_MultigraphWithErrorbars.svgsvg gnuplot_56c40163966ced3994a99fc1f060f6e1_MultigraphWithErrorbars.svg manage 9 K 02 May 2014 - 10:50 MichaelDaum Auto-attached by GnuPlotPlugin
gnuplot_655072823f5c098a63bd1bb4b51d43fd_TestInstall.svgsvg gnuplot_655072823f5c098a63bd1bb4b51d43fd_TestInstall.svg manage 9 K 02 May 2014 - 10:50 MichaelDaum Auto-attached by GnuPlotPlugin
gnuplot_c96b576d7a7ff521cf242137e3a73048_DampedSinus.svgsvg gnuplot_c96b576d7a7ff521cf242137e3a73048_DampedSinus.svg manage 20 K 02 May 2014 - 10:50 MichaelDaum Auto-attached by GnuPlotPlugin
gnuplot_dc49080a70cc4879a80c08603cb17eef_RosenbrockFunction.svgsvg gnuplot_dc49080a70cc4879a80c08603cb17eef_RosenbrockFunction.svg manage 192 K 02 May 2014 - 10:50 MichaelDaum Auto-attached by GnuPlotPlugin
whale.datdat whale.dat manage 92 K 11 Jul 2016 - 11:38 MichaelDaum  
Topic revision: r3 - 11 Jul 2016, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy