From 13f57d6ea2cc533734d862450b8f8fd0b1524ee4 Mon Sep 17 00:00:00 2001 From: MichaelDaum Date: Wed, 30 Apr 2014 18:19:44 +0000 Subject: [PATCH] Item12873: docu git-svn-id: http://svn.foswiki.org/trunk/GnuPlotPlugin@17618 0b4bb1d4-4e5a-0410-9cc4-b2b747904278 --- data/System/GnuPlotPlugin.txt | 49 ++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/data/System/GnuPlotPlugin.txt b/data/System/GnuPlotPlugin.txt index e7da895..cd2145d 100644 --- a/data/System/GnuPlotPlugin.txt +++ b/data/System/GnuPlotPlugin.txt @@ -1,7 +1,7 @@ -%META:TOPICINFO{author="ProjectContributor" comment="reprev" date="1398880089" format="1.1" reprev="16" version="16"}% +%META:TOPICINFO{author="ProjectContributor" comment="reprev" date="1398881747" format="1.1" reprev="17" version="17"}% ---+!! %TOPIC% -%SHORTDESCRIPTION{default=""}% +%SHORTDESCRIPTION% Gnuplot is a portable graphing utility. It was originally created to allow scientists and students to visualize mathematical functions @@ -16,9 +16,29 @@ See the full documentation of gnuplot itself at http://www.gnuplot.info/document ---++ Syntax Rules - * Just add =%GNUPLOT{"PlotName"}%= anywhere in the page where you want the plot to appear and save the topic - * Multiple plots can be displayed within one topic - * Any CSV (Comma Seperated Variable) file attached to the topic can be used with the plot or splot commands +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%VBAR%section"= | specifies the mode of operation | attachment | +| =topic="..."= | name of a topic to read a section (or attachment) from | current topic | +| =type="gif%VBAR%jpeg%VBAR%png%VBAR%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>%VBAR%dynamic%VBAR%fixed"= | geometry of the image being generated; values =dynamic= and =fixed= only make sense for =type="svg"= | =$width x $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 @@ -83,13 +103,12 @@ The following images are examples of plots generated by !GnuPlot: - -| Author: | TWiki:Main.AbieSwanepoel, Foswiki:Main.MichaelDaum | +| Authors: | TWiki:Main.AbieSwanepoel, Foswiki:Main.MichaelDaum | | Copyright: | © 2006 TWiki:Main.AbieSwanepoel; 2007-2014 Foswiki Contributors http://foswiki.org | | Version: | %$VERSION% | | Release: | %$RELEASE% | | Change History: || -| 28 Apr 2014: | rewrite (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) | @@ -110,10 +129,10 @@ The following images are examples of plots generated by !GnuPlot: %META:FILEATTACHMENT{name="CIAWorldDataBankIIDenmark.data" attr="" autoattached="1" comment="Data for CIAWorldDataBankIIDenmark example" date="1146425499" moveby="micha" movedto="System.GnuPlotPlugin.CIAWorldDataBankIIDenmark.data" movedwhen="1398868039" movefrom="System.GnuPlotPlugin.CIAWorldDataBankIIDenmarkData.data" path="CIAWorldDataBankIIDenmarkData.data" size="403115" user="ProjectContributor" version="1"}% %META:FILEATTACHMENT{name="MultigraphWithErrorbars.data" attr="" autoattached="1" comment="Data for MultigraphWithErrorbarsData example" date="1146425499" moveby="micha" movedto="System.GnuPlotPlugin.MultigraphWithErrorbars.data" movedwhen="1398868055" movefrom="System.GnuPlotPlugin.MultigraphWithErrorbarsData.data" path="MultigraphWithErrorbarsData.data" size="66" user="ProjectContributor" version="1"}% %META:FILEATTACHMENT{name="DampedSinus.data" attr="" autoattached="1" comment="Data for DampedSinusData example" date="1146425499" moveby="micha" movedto="System.GnuPlotPlugin.DampedSinus.data" movedwhen="1398868061" movefrom="System.GnuPlotPlugin.DampedSinusData.data" path="DampedSinusData.data" size="4091" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="gnuplot_655072823f5c098a63bd1bb4b51d43fd_TestInstall.svg" attachment="gnuplot_655072823f5c098a63bd1bb4b51d43fd_TestInstall.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398880088" size="9949" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="gnuplot_56c40163966ced3994a99fc1f060f6e1_MultigraphWithErrorbars.svg" attachment="gnuplot_56c40163966ced3994a99fc1f060f6e1_MultigraphWithErrorbars.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398880088" size="9527" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="gnuplot_c96b576d7a7ff521cf242137e3a73048_DampedSinus.svg" attachment="gnuplot_c96b576d7a7ff521cf242137e3a73048_DampedSinus.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398880088" size="20924" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="gnuplot_1ac8b9f150aeb9dd95e56ca9e8977a07_CIAWorldDataBankIIDenmark.svg" attachment="gnuplot_1ac8b9f150aeb9dd95e56ca9e8977a07_CIAWorldDataBankIIDenmark.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398880089" size="359423" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="gnuplot_26c785a639935a588e205850a8744f76_InterlockingTori.svg" attachment="gnuplot_26c785a639935a588e205850a8744f76_InterlockingTori.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398880089" size="84516" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="gnuplot_0578c5af104caee4c9eefcf4183da270_BlueWhale.svg" attachment="gnuplot_0578c5af104caee4c9eefcf4183da270_BlueWhale.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398880089" size="67740" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="gnuplot_dc49080a70cc4879a80c08603cb17eef_RosenbrockFunction.svg" attachment="gnuplot_dc49080a70cc4879a80c08603cb17eef_RosenbrockFunction.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398880089" size="196945" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="gnuplot_655072823f5c098a63bd1bb4b51d43fd_TestInstall.svg" attachment="gnuplot_655072823f5c098a63bd1bb4b51d43fd_TestInstall.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398881746" size="9949" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="gnuplot_56c40163966ced3994a99fc1f060f6e1_MultigraphWithErrorbars.svg" attachment="gnuplot_56c40163966ced3994a99fc1f060f6e1_MultigraphWithErrorbars.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398881746" size="9527" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="gnuplot_c96b576d7a7ff521cf242137e3a73048_DampedSinus.svg" attachment="gnuplot_c96b576d7a7ff521cf242137e3a73048_DampedSinus.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398881746" size="20924" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="gnuplot_1ac8b9f150aeb9dd95e56ca9e8977a07_CIAWorldDataBankIIDenmark.svg" attachment="gnuplot_1ac8b9f150aeb9dd95e56ca9e8977a07_CIAWorldDataBankIIDenmark.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398881747" size="359423" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="gnuplot_26c785a639935a588e205850a8744f76_InterlockingTori.svg" attachment="gnuplot_26c785a639935a588e205850a8744f76_InterlockingTori.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398881747" size="84516" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="gnuplot_0578c5af104caee4c9eefcf4183da270_BlueWhale.svg" attachment="gnuplot_0578c5af104caee4c9eefcf4183da270_BlueWhale.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398881747" size="67740" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="gnuplot_dc49080a70cc4879a80c08603cb17eef_RosenbrockFunction.svg" attachment="gnuplot_dc49080a70cc4879a80c08603cb17eef_RosenbrockFunction.svg" attr="" comment="Auto-attached by GnuPlotPlugin" date="1398881747" size="196945" user="ProjectContributor" version="1"}%