Differences

This shows you the differences between two versions of the page.

wiki:projects:php:dokuwiki:plugins:gnuplot [2010/03/11 09:34]
205.202.121.244 ibyYCfsMPkcy
wiki:projects:php:dokuwiki:plugins:gnuplot [2010/06/23 13:46] (current)
e-razor old revision restored
Line 1: Line 1:
-af0j0N &lt;a href=&quot;http://eqqaugygjudt.com/">eqqaugygjudt</a>, [url=http://wevuldernpdm.com/]wevuldernpdm[/url], [link=http://wyzkhjvschim.com/]wyzkhjvschim[/link], http://ouyzvifkvwvm.com/+====== GNUplot Plugin ====== 
 +It is based on [[http://wiki.ioslo.net/dokuwiki/graphviz|the great graphviz plugin]] by Carl-Christian Salvesen. 
 + 
 +I'm not going to explain much stuff here, just install [[http://gnuplot.sourceforge.net/|gnuplot]] and you'll be fine ;-). 
 + 
 + 
 +===== News/Changes ===== 
 +==== 24.08.2005 ==== 
 + * darcs repository created 
 + 
 +===== Installation (with darcs) ===== 
 +  $&gt; cd dokuwiki/lib/plugins 
 +  $> darcs get http://darcs.erazor-zone.de/php/dokuwiki/plot/ 
 +==== Update ==== 
 +  $> darcs pull 
 + 
 +==== latest changes ==== 
 +{{rss>http://dev.erazor-zone.de/darcsweb.cgi?r=php/dokuwiki/plot;a=rss}} 
 + 
 +==== lastest dist ==== 
 +  * http://darcs.erazor-zone.de/php/dokuwiki/plot/plot.tar.gz 
 + 
 +==== Source files ==== 
 +++++ inc/plugins/plot/syntax.php | 
 +&lt;source http://darcs.erazor-zone.de/php/dokuwiki/plot/syntax.php/
 +++++ 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 +===== Examples ===== 
 +  * a lot more could be found here: http://gnuplot.sourceforge.net/demo/ 
 + 
 +<code> 
 +<plot> 
 +plot [-20:20] cos(x)/x 
 +</plot> 
 +</code> 
 + 
 +<plot> 
 +plot [-20:20] cos(x)/x 
 +</plot> 
 + 
 + 
 +<code> 
 +<plot> 
 +set contour base 
 +set cntrparam levels incremental -20,5,10 
 +set title "9 incremental contours starting at -20, stepping by 5" 0.000000,0.000000  font "" 
 +splot x*y 
 +</plot> 
 +</code> 
 +<plot> 
 +set contour base 
 +set cntrparam levels incremental -20,5,25 
 +set title "9 incremental contours starting at -20, stepping by 5" 0.000000,0.000000  font "" 
 +splot x*y 
 +</plot> 
 + 
 +==== Hints ==== 
 +  * hints for other releases 
 +  * check [[http://pear.php.net/package/PHP_Compat/download|PHP_Compat]] lib for file_put_contents.php. 
 +  * <del>dokuwiki-2005-06-11</del> 
 +    * <del>change the path to fetch.php: **lib/exe/fetch.php**</del> 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 +==== Comments ==== 
 +>Sweet. You inherited my namespace-bug. :-) The output should live in the same namespace as the >referring page. But still; Sweet. --- //[[calle@ioslo.net|Carl-Christian Salvesen]] 2005/06/07 00:33// 
 +>>Well, youre right, but this one saves some cpu-usage when rendering the same stuff in different namespaces :-) 
 + 
 +---- 
 + 
 +>This looks very cool, but I am unable to get it working with the latest stable dokuwiki though.  Reasons for this may be (it's lib/plugins now instead of inc/plugins).  Tried changing syntax.php to use lib/plugins and /sw/bin/gnuplot, still no go.  Fudged with ACLs for media:plot and also tried changing from /tmp to /path/writable/by/webserver.  Any ideas, or if possible, it would be great to have a simple step by step howto that applies to the latest dokuwiki.  Thanks alot for all your efforts.  Nick 
 +>>I had to heavily hack the gnuplot command to get it to work.  My system has gnuplot version 4 patchlevel 0 installed...I ended up with "set terminal png transparent color medium picsize 420 320"...you could play around with commandline gnuplot to find the settings that work for you.  It might be helpful if there were a config option to allow basic setup. =G= 
 + 
 +---- 
 + 
 +> 2006Feb09 
 +> What does this mean?  'change the path to fetch.php: lib/exe/fetch.php' 
 +>> [[user>e-razor|E-Razor:]] Don't care about it, i used 'fetch.php' in the first versions, see patch:  [[http://dev.erazor-zone.de//darcsweb.cgi?r=php/dokuwiki/plot;a=filediff;h=20050925172041-0ad7b-e55ed0022c28b3e285e51480030888b7586fbbb1.gz;f=syntax.php|  20050925172041-0ad7b-e55ed0022c28b3e285e51480030888b7586fbbb1.gz]] 
 + 
 +---- 
 + //[[ariza.federico@gmail.com|Federico Ariza]] 2007/03/14// 
 + 
 + I have no idea how to add a patch to this plugin (I sent a diff file to the author...), so I will add it here. 
 + 
 + I took this piece of code from the gnuplot plugin of mediawiki.  
 + In the function  **createImage($filename, &$data)**  after defining **$tmpfname** add the following 
 + 
 + <code>while (strpos($data, 'src:') != false) { 
 +            $srcStartPosition = strpos ($data, 'src:') + strlen("src:"); 
 +            $srcEndPosition = strpos ($data, ' ', $srcStartPosition); 
 +            $tmpString = substr($data, $srcStartPosition, $srcEndPosition-$srcStartPosition-1); 
 +            $srcFileNamePath = $conf['mediadir'] .$tmpString; 
 +            $data = str_replace("src:$tmpString",$srcFileNamePath,$data); 
 +        } 
 + 
 +</code> 
 + this will make possible to use data loaded to your media folder, for example if you loaded **playground/datos.txt** to your mediafolder the following code will plot using the data stored in the **datos.txt** file 
 +<code><plot> 
 +set key left 
 +plot  'src:/playground/datos.txt' using 1:2 ti "my graph" 
 +</plot></code> 
 +  
 + 
 + 
 +When i install this plugin i have this error : 
 + 
 + 
 +Warning: main(/usr/lib/php/PHP/Compat/Function/file_put_contents.php) [function.main]: failed to open stream: No such file or directory in (..)/htdocs/wiki/lib/plugins/plot/syntax.php on line 12 
 + 
 +Fatal error: main() [function.require]: Failed opening required '/usr/lib/php/PHP/Compat/Function/file_put_contents.php' (include_path='.:/usr/local/lib/php') (...)/htdocs/wiki/lib/plugins/plot/syntax.php on line 12 
 + 
 +(I'm french) 
 + 
 + 
 + 
 + 
 +---- 
 +I replaced 
 +<code>$tmpfname = tempnam("/tmp", "dokuwiki.plot");</code> 
 +with 
 +<code>$tmpfname = tempnam(DOKU_PLUGIN."/tmp", "dokuwiki.plot");</code> 
 +because write to /tmp isnt allowed. 
 +this tmp dir is used by multiple plugins yet. 
 + 
 +But cool Plugin :) - i'm using it together with dokutexit. 
 + 
 +//[[white.addoma.de|Gabor]] 2008/06/12// 
 
wiki/projects/php/dokuwiki/plugins/gnuplot.txt · Last modified: 2010/06/23 13:46 by e-razor
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki