Extension talk:Gnuplot
From MediaWiki.org
Contents |
[edit] 2007
[edit] Which code version
Should I be using the code on this page or the http://meta.wikimedia.org/wiki/Gnuplot? It seems like this one is further along, since it has the <dataset> tag and the other one doesn't. But the other one is in SVN, so can anyone with the official word chime in with it? --9 March 2008
- This one was developed before I even knew that one existed... My version gets rid of the need to define the output stuff... and yeah, the dataset is helpful for inlining raw data, which was my real intent for creating it. Yeah, I should migrate it to SVN.. haven't been doing that with the extensions I've been writing.. Glad someone is taking a look at it :) --DavidSeymore 17:08, 14 March 2008 (UTC)
[edit] Another example using some real data and '3d' mode
This is an example of the GnuPlot extension tracking opteron prices and creating a 3d graph.. spun and whatnot
<gnuplot>
set title "Price of Opteron"
set xlabel "Gigahertz"
set zlabel "$$"
set ylabel "Date"
set ydata time
set timefmt "%m/%d/%Y"
set format y " %m/%Y"
set ytics ("01/20/2008", "03/14/2008")
set style data lines
set view 50,200,1,1
set grid z
splot \
<dataset>
2.2 01/20/2008 100 #gighz.. date.. dollars
2.4 01/20/2008 150
2.6 01/20/2008 270
2.8 01/20/2008 480
3.0 01/20/2008 700
2.2 03/14/2008 100
2.4 03/14/2008 122
2.6 03/14/2008 245
2.8 03/14/2008 410
3.0 03/14/2008 700
</dataset> using 1:2:3 title "Dual Core" with lines, \
<dataset>
1.9 01/20/2008 330
2.0 01/20/2008 415
2.2 01/20/2008 650
2.3 01/20/2008 800
2.4 01/20/2008 1115
2.5 01/20/2008 1275
1.9 03/14/2008 330
2.0 03/14/2008 270
2.2 03/14/2008 480
2.3 03/14/2008 720
2.4 03/14/2008 925
2.5 03/14/2008 1235
</dataset> using 1:2:3 title "Quad Core" with lines
</gnuplot>
produces:
--DavidSeymore 15 March 2008
[edit] 2008
[edit] Problems with gnuplot working via IIS (I think)
The webserver is runing on Windows 2003 server.
Here is what works:
- I can get gnuplot to execute via the command line.
- I can call it via a php script.
- Once the png file is produce the wiki will display it.
What I can't get to work:
- The shell_exec does not execute the command via the web browser through IIS.
I beleive I have all the permissions set up correctly. I finally found this hint on the http://meta.wikimedia.org/wiki/Talk:Gnuplot page.
“Instead of digging through a log file on the server, I wanted to be able to see the gnuplot diagnostics output. I made some minor tweaks to the code by combining stdout & stderr, capturing the output, then displaying it (if there is any output):
$cmdlinePlot = wfEscapeShellArg($wgGnuplotSettings->gnuplotCommand)
. ' ' . $fname . ' 2>&1';
$shelloutput=shell_exec($cmdlinePlot);
if (strlen($shelloutput) > 0) {
$shellerror="<br><pre>Gnuplot ERROR message:<br>$shelloutput< /pre>";
} else $shellerror="";
// some cleanup
unlink($fname);
}
return "<p><b><img src=\"" . $wgUploadPath . $gnuplotDir . $name .
"\" alt=\"Gnuplot Plot\"></b><p>$shellerror" ;
(note on the line with ERROR above, I put a space before /pre; I couldn't get the html syntax to pass through uninterpreted... you'll need to remove the space).
I'd add this directly to the listed code, but I don't want to break stuff for others if the stderr+stdout (2>&1) statement is wrong for some folks.”
What is returned is "Can't find the gnuplot window". Does anyone have any thoughts?
When I hardcode the $cmdlinePlot to "php -version" or "dir" I receive valid responses. So does it have to do with the configuration or environment variables?
--ChrisWolcott 9:00, 20 May 2008 (UTC)
[edit] Gnuplot and MediaWiki
Hi, got a little problem with gnuplot and the mediawiki.
I set a path (//home/user/GnuPlotData/) where every user uloads his ASCII Data in Textfilez. The WikiCode mostly looks the same for all plots:
<gnuplot>set title "Title"
#set yrange [-5:40]
#set xtics (0,1,2,3,4,5,6,7,8,9,10)
#set xrange [0:10]
set xlabel "X Axis"
set ylabel "y axis"
plot "//home/user/public_html/GnuPlotData/FileName.txt" using 1:2 title "DAC vs. LED Current" with lines lt 4</gnuplot>
Pretty easy, the user can uload his data and everything is fine....mostly everything. If I ulpoad a picture, the parser plots ist. Now I want to change the raw data at the FileName.txt. So I uloaded via scp a new File. The parser doesnt detect any changes, so the plot stays the same. :-( Only after editing the page again and changing the labe, titel ore something, its detected as a new plot.
Do you know a way tho change that?
Sincerly yours
Sebastian Basti0001 1 September 2008
[edit] Getting started
Hi
I tried to get the extension running following the instructions given, but could not get any result at all:
OS: windows XP SP2 Mediawiki: 1.13.1 PHP: 5.25 mySql: 5.051
I tried several settings for the Gnuplot path, nothing works, albeit gnuplot seems to do its task when triggered offline.
Do you have any suggestions how I could narrow down what is missing?
Kind regards Albert Cremer 09:43, 20 September 2008 (UTC)
[edit] Gnuplot and Rss
Once the Gnuplot extension is installed, que RSS feed of the wiki are not functioning.
any idea how to work this out??
thanks --150.214.36.10 16:34, 29 September 2008 (UTC)
[edit] Not plotting, only showing "gnuplot plot"
Hello I have the newest version of mediawiki running on the newest version of an ubunu linux with apache (turnkey linux). Unfortunately, after the installation of this extension, exactly following the manual, I do not get plots shown, but only the text:
"Gnuplot Plot"
Via ssh gnuplot runs fine on the command line.
In my LocalSettings.php (everything else there runs nice) I added the lines:
# These lines include the extension "Gnuplot" as described in http://www.mediawiki.org/wiki/Extension:Gnuplot include("extensions/Gnuplot/Gnuplot.php"); $wgGnuplotCommand = "gnuplot";
Does anyone of you have an idea, what could be the reason? Thanks! --131.188.210.184 18:54, 6 August 2009 (UTC)