これは便利!
プラグインを入れることでWordPressでgnuplotが使えます。
使うプラグインは『GNUPlot』というものです。
GNUPlot wordpress plugin v1.1に詳しい説明があります。
プラグイン→新規追加でGNUPlotを導入し、有効化します。
その後サーバーへアクセスし、“wp-content”ディレクトリの中に”cache”という名前のディレクトリを作ります(wp-content/cache)。
これでできるはず。
間違って
wp-content/plugins/gnuplot-wordpress-plugin/
や
wp-content/plugins/
にディレクトリを作らないように注意しましょう。
使う際は
[gplot]ここにコマンド[/gplot]
として書いてあげればokです。
どうやらデータをプロットすることはできないようです。
Responses to “GNUPlot wordpress plugin v1.1”でのやり取りを見ると、
4. aneubau Says:
February 13th, 2009 at 8:41 am
Is it possible to load data from a file on the server with this plugin ?
5. Mohamed Ibrahim Says:
February 13th, 2009 at 11:05 pm
No its not. I run an edited version of GNUPlot. If you found a way, let me know :)
というやり取りがありました。5.で回答しているのがこのプラグインの製作者です。
製作者自体はデータを読み込むことを想定して作っているわけではないが、もしかしたら読み込ませる方法があるのかも。という回答をしています。
また、生成されたgnuplotの画像のデータはディレクトリcache内に残るようなので定期的に消すべきでしょう。
間違って、試しに生成された画像も残るようです。
僕がサーバーの容量を圧迫し始めたら消すので、このページを編集する人は失敗とか気にしないでねミ
また、サイズはset size 0.8,0.5などを用いて小さく変えるほうがいいと思います。
以下は
[gplot]
set size 0.5,0.3
set xr[-3:3]
set yr[-1:1]
plot sin(x)
[/gplot]
とした時の表示です↓
[gplot]
set size 0.5,0.3
set xr[-3:3]
set yr[-1:1]
plot sin(x)
[/gplot]
リーマン面だってこの通り!!
[gplot]
set view 60,240,1,1
set size 0.8,0.5
i={0,1}
set parametric
set isosamples 70
set xlabel “x axis”
set ylabel “y axis”
set zlabel “z axis”
unset sur
set palette defined(0″#00008b”,1″#2ca9e1″,2″#38b48b”,3″#ffff00″,4″#eb6101″,5″#c9171e”)
set ticslevel 0
set pm3d
set pm3d depthorder
set zr[-2.5:2.5]
splot u*cos(v),u*sin(v),real(sqrt(u)*exp(i*0.5*v))
[/gplot]
set view 60,240,1,1
set size 0.8,0.5
i={0,1} #虚数単位iの定義
set parametric #媒介変数を使いますという宣言
set isosamples 70 #描写するときに70点使用します
set xlabel "x axis" #x軸の名前
set ylabel "y axis" #y軸の名前
set zlabel "z axis" #z軸の名前
unset sur #表面の線を見えなくする
set palette defined(0"#00008b",1"#2ca9e1",2"#38b48b",3"#ffff00",4"#eb6101",5"#c9171e")
#カラーマップの変更
set ticslevel 0 #z軸の下をxy平面に一致させる
set pm3d #pm3dを使います
set pm3d depthorder #3dプロット時の陰面処理
set view equal xy #x軸とy軸のメモリ間隔を一致させる
set zr[-2.5:2.5]
splot u*cos(v),u*sin(v),real(sqrt(u)*exp(i*0.5*v))