Skip to content

Commit

Permalink
Item12873: docu
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/GnuPlotPlugin@17618 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Apr 30, 2014
1 parent 2d03547 commit 13f57d6
Showing 1 changed file with 34 additions and 15 deletions.
49 changes: 34 additions & 15 deletions 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
Expand All @@ -16,9 +16,29 @@ See the full documentation of gnuplot itself at http://www.gnuplot.info/document

---++ Syntax Rules

* Just add =%<nop>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 =%<nop>GNUPLOT{&lt;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="&lt;integer>"= | width of the image being generated | 640 |
| =height="&lt;integer>"= | height of the image being generated | 480 |
| =size="&lt;integer>x&lt;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:

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

---++ Examples

Expand Down Expand Up @@ -83,13 +103,12 @@ The following images are examples of plots generated by !GnuPlot:
<!--
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION%
-->

| Author: | TWiki:Main.AbieSwanepoel, Foswiki:Main.MichaelDaum |
| Authors: | TWiki:Main.AbieSwanepoel, Foswiki:Main.MichaelDaum |
| Copyright: | &copy; 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) |
Expand All @@ -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 <nop>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 <nop>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 <nop>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"}%

0 comments on commit 13f57d6

Please sign in to comment.