LoginSignup
1
1

More than 1 year has passed since last update.

WindowsでCygwinでgnuplotを使うための作業

Last updated at Posted at 2022-12-01

概要

PCを新調したのでCygwinでgnuplotを使える環境を改めて作る。この先また困るだろうからとりあえず記録でもつけておく。

Cygwinの作業

https://www.cygwin.comからsetup-x64.exeをダウンロード。Cygwin/Xのほうからはダウンロードできなかった。
setpu-64.exeを起動して進める。

packageをいれる

左上にあるViewからCategoryを選択し、baseをまとめて入れた。検索窓からgnuplotと検索してgnuplot-X11、gnuplot-base、gnuplot-debuginfoを入れた。
あとは、遊ぶためにxeyesを入れた。

よくわからん設定。.bashrc

このまま進めてもディスプレイを認識できないらしい。cygwin64/home/ownerにある.bashrcをエディタで開いて、上の方に

.bashrc
DISPLAY=localhost:0

と書き込んだ。

Xmingの作業

https://ja.osdn.net/projects/sfnet_xming/releases/のXming-6-9-0-31-setup.exeをダウンロードした。起動して適当に進める。XmingとXLaunchが入る。インストーラを終わる際にかってにLaunchしてくれた、確か。のちにXLaunchを起動しただ次へを押し続けて終わった。

gnuplotの作業

gnuplotのterminalをx11にする。gnuplotを起動してからset terminal x11でできるけど起動する度にやるのは面倒。そこで、cygwin64/home/ownerにファイル.gnuplotを作って中に

.gnuplot
reset
set terminal x11

と書き込む。gnuplotを起動する際に自動で実行されるらしい。

これで作業は完了。

使う

Xmingを起動する。バックグラウンドでXmingが走っているあいだにCygwin64 Terminalを起動する。あとはgnuplotで何か描くなり好きにしておくれ。その際、unable to open dysplay 'localhost:0'などと出るならば、Xmingが起動できていないかterminalがx11ではないかのどちらかが原因だと思う。

1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1