简体   繁体   English

Octave没有阴谋

[英]Octave does not plot

When I try to plot a graph on GNU Octave, and try to use plot, it gives me the following output 当我尝试在GNU Octave上绘制图形并尝试使用plot时,它给出了以下输出

set terminal aqua enhanced title "Figure 1" size 560 420  font "*,6" dashlength 1
                  ^
     line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list

I am using Mac OS X 10.9.2. 我使用的是Mac OS X 10.9.2。 I have tried using 我试过用

octave:79> setenv("GNUTERM","X11")

but I still get the same error. 但我仍然得到同样的错误。

setenv("GNUTERM","qt")在你的octave命令提示符下,它应该解决问题。

I think your problem comes from using the CLI. 我认为您的问题来自于使用CLI。

As of January 2, 2014. If you're using OS/X 10.9 (Maverics) then you can opt to use integrated GUI from the binary package by downloading the Octave 3.8.0 .dmg . 截至2014年1月2日。如果您使用的是OS / X 10.9(Maverics),那么您可以通过下载Octave 3.8.0 .dmg来选择使用二进制包中的集成GUI。 Use Octave-gui not Octave-cli, or otherwise start the GUI from the CLI. 使用Octave-gui而不是Octave-cli,或者从CLI启动GUI。

A note about the gui from The Octave Home Page 来自Octave主页的关于gui的注释

But because it is not quite as polished as we would like, we have decided to wait until the 4.0.x release series before making the GUI the default interface (until then, you can use the --force-gui option to start the GUI). 但是因为它没有我们想要的那么完美,我们决定等到4.0.x发布系列之后再将GUI作为默认界面(在那之前,你可以使用--force-gui选项来启动GUI )。

The following worked out for me 以下为我解决了问题

  1. Uninstall any existing gnuplot on your OSX 卸载OSX上的任何现有gnuplot

    brew uninstall gnuplot

  2. Install gnuplot with either X or X11 使用X或X11安装gnuplot

    brew install gnuplot --with-x

  3. Finally, set the GNUTERM to X11 最后,将GNUTERM设置为X11

    setenv("GNUTERM","X11")

And if you need Aqua terminal instead of X11 - this might help: 如果您需要Aqua终端而不是X11 - 这可能会有所帮助:

brew uninstall --force gnuplot

brew install gnuplot --with-aquaterm --with-qt4

You don't need to add setenv("GNUTERM","X11") or add GNUTERM env.var to octaverc file. 您不需要添加setenv(“GNUTERM”,“X11”)或将GNUTERM env.var添加到octaverc文件中。

I've got this problem too and solved by installing an Aquaterm for mac as mentioned here . 我也遇到了这个问题并通过安装Aquaterm for mac解决了这里提到的问题

ps If you get warnings like "warning: could not match any font: *-normal-normal-10" as I did, try to check your /usr/local/etc/fonts/fonts.conf ps如果您收到警告,例如“警告:无法匹配任何字体:* -normal-normal-10”,请尝试检查您的/usr/local/etc/fonts/fonts.conf

To install it without aquaterm: 要在没有aquaterm的情况下安装它:

brew cask install xquartz
brew install gnuplot --with-x
brew install octave

vim ~/.octaverc
setenv("GNUTERM", "X11")
graphics_toolkit("gnuplot");

使用Octave-cli时我遇到了同样的问题,我只是通过使用“Octave-gui”来避免这种情况。

Download and install Aquaterm. 下载并安装Aquaterm。

sudo wget https://gist.githubusercontent.com/tuvistavie/8466870/raw/9064b4b3dfb3644950b6f5745056f54f8d6e56c6/gnuplot.rb -O /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gnuplot.rb

brew uninstall gnuplot
brew update && brew upgrade
brew tap homebrew/science
brew info gnuplot

brew reinstall gnuplot --aquaterm --qt --test

worked for me ref 为我工作参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM