前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >2018-12-20 WARNING: Plotting with an 'unknown' terminal. No output will be generated. Please sele...

2018-12-20 WARNING: Plotting with an 'unknown' terminal. No output will be generated. Please sele...

作者头像
Albert陈凯
发布2018-12-27 15:56:19
1.8K0
发布2018-12-27 15:56:19
举报
文章被收录于专栏:Albert陈凯Albert陈凯

《程序员的数学 3:线性代数》配套代码使用的说明补充

在随书下载的说明网页中,简单交代了配套代码的使用方法。有读者反馈说,对“配 置好 Ruby 和 Gnuplot 环境”不太明白。这里确实有点抱歉,原作者可能默认是 Linux(或 者 Mac OS)系统的。对其他情况,这里稍加说明。 另注:运行结果中,只通过蓝色网格和紫色剪头的变化,就可以直观的“看”到线性 变换。对于绿色的线段可以无视,那是作者为了让大家看的更明显而卖的萌,画出了一个 日文片假名的ゲ(ge)的形状。

如果你的系统是 Mac OS,因为 Mac OS 是内置 Ruby 的,至少 Ruby 就不是问题了。这 时,最简单的办法是用 Homebrew (http://brew.sh/index_zh-cn.html)等包管理软件进 行 Ruby 的升级和 Gnuplot 的安装。安装 Homebrew 之后,在终端中执行

代码语言:javascript
复制
brew update
brew install ruby

即可更新到最新的 Ruby。接下来,

代码语言:javascript
复制
brew install gnuplot --with-x11

即可安装好 Gnuplot。这里特别提醒,对于 OS X Yosemite(10.10)版本之后的用户,强烈 建议加上“--with-x11”选项以防之后出现图像显示不出的问题。 如果你喜欢自己下载源代码自己编译,我相信你应该不会有上述提到的问题。只是对 于 OS X Yosemite(10.10)版本之后的系统,Gnuplot 在编译时,可能需要修改一下配置文 件。需要在源代码的“configure”中加入 x11 的位置如下:

代码语言:javascript
复制
# Standard set of common directories for X headers.     
# Check X11 before X11Rn because it is often a symlink to the current release.      
---added the location of my X11 files also          
/opt/X11/include

之 后 按 正 常 步 骤 编 译 即 可 。( 参 考 : http://apple.stackexchange.com/questions/103814/cant-plot-with-gnuplot-on-my-mac , 亲测有效。) 在使用本书代码时,只需要按照书中附录提供的命令行,在终端中运行即可。特别要 注意,下载的 rb 文件需要在你的终端的当前目录之下。最后附上译者电脑上的运行效果。

虽然按照上面的步骤操作但还是不行

最有的操作步骤

代码语言:javascript
复制
 2398  cd 程序员的数学3
 2399  ls
 2400  ruby mat_anim.rb -s=0 | gnuplot
 2401  brew install -y gnuplot
 2402  ruby mat_anim.rb -s=0 | gnuplot
 2403  brew uninstall gnuplot; brew install gnuplot --with-x11
 2404  brew uninstall gnuplo
 2405  brew uninstall gnuplot
 2406  brew install -y gnuplot --with-x11
 2407  brew install formula -y
 2409  brew cask install xquartz
 2410  brew install -y gnuplot --with-x11
 2411  history
 2412  ruby mat_anim.rb -s=0 | gnuplot
 2414  gnuplot
 2415  brew install Caskroom/cask/aquaterm
 2416  brew uninstall gnuplot
 2417  history
 2418  brew install -y gnuplot --with-x11 --with-aquaterm --with-qt4
 2419  history
 2421  ruby mat_anim.rb -s=0 | gnuplot

https://stackoverflow.com/questions/32086405/warning-plotting-with-an-unknown-terminal-no-output-will-be-generated-pleas

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018.12.20 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档