GNUPlot:终端设置未知

GNUPlot:终端设置未知
    G N U P L O T
    Version 4.6 patchlevel 4    last modified 2013-10-02 
    Build System: Linux x86_64

    Copyright (C) 1986-1993, 1998, 2004, 2007-2013
    Thomas Williams, Colin Kelley and many others

    gnuplot home:     http://www.gnuplot.info
    faq, bugs, etc:   type "help FAQ"
    immediate help:   type "help"  (plot window: hit 'h')
    Terminal type set to 'unknown'
    gnuplot>

你好,gnuplot 显示终端类型设置为“未知”。
如果我输入以下命令。

gnuplot> plot "./MergePlot.dat" with linespoint

什么都没发生。

答案1

设置正确的终端

您发现的错误意味着格努普特无法识别有效终端。您必须设置一个有效终端。要了解可用终端的列表,您可以从 gnuplot 的命令行询问

gnuplot> set terminal 

它会回答类似

Available terminal types:
       cairolatex  LaTeX picture environment using graphicx package 
                   and Cairo backend
           canvas  HTML Canvas object
              cgm  Computer Graphics Metafile
          context  ConTeXt with MetaFun (for PDF documents)
            corel  EPS format for CorelDRAW
             dumb  ascii art for anything that prints text

              ...  Many linees  ...

              gif  GIF images using libgd and TrueType fonts
             gpic  GPIC -- Produce graphs in groff using the 

              ...  Other linees  ...

对于其中的每一个,您都可以向 gnuplot 本身询问更多信息,例如使用help terminal gif

然后你可以简单地设置终端,如果你已经尝试过哑的一个很可爱。

gnuplot> set terminal dumb
gnuplot> plot 0.5*sin(x/2)  lt 0, cos(x/2)



    1 ++---------------+---------------####---------------+---------------++
      +                +             ##  + ##          0.5*sin(x/2) +....+ +
  0.8 ++                            #        #             cos(x/2) ######++
      |                            #          #                            |
  0.6 ++                          #            #                          ++
      |++++++                    #              #+++++++                   |
  0.4 ++    +++                 #             ++ #     +++                ++
      #       +++               #           ++   #        ++               #
  0.2 +#        ++            ##          ++      ##        +             #+
    0 +#          ++          #          ++        #         ++           #+
      | #          ++        #         ++           #         ++         # |
 -0.2 ++ #           +      #         ++             #          ++      # ++
      |  ##           ++    #       ++               #           +++   ##  |
 -0.4 ++   #            +++#      ++                  #            +++#   ++
      |     #             #+++++++                     #             #+++++|
 -0.6 ++    #             #                            #             #    ++
      |      ##         ##                              ##         ##      |
 -0.8 ++      #        #                                  #        #      ++
      +        ##    ###                 +                ###    ##        +
   -1 ++---------#####-+-----------------+----------------+-#####---------++
     -10              -5                 0                5                10

如果你没有机会使用终端“你可以看到”wxtqtx11aqua...),使用图形格式并将输出保存在外部文件中。这样,您将在运行 gnuplot 的目录中创建一个文件。

set terminal png enhanced truecolor    # ... whatever ...
  set output 'tempfile.png'            # you need to redirect to a file the output 
    plot 0.5*sin(x/2)  lt 0, cos(x/2)  # your plot commands     
    # replot # it should be cosy if you are not doing multiplot 
  set out                              # restore the output redirection
set terminal GNUTERM                   # restore the default terminal

注意:
您可能需要安装不同的软件包-qt,-nox,-x11以获得不同的功能(OP 刚刚这样做了)或者自行编译以添加其他功能。

答案2

你肯定误解如何使用 gnuplot。
您没有告诉 gnuplot 它要绘制什么。

以及输出应该是什么样的。

手册。否则,如果你没有读过手册,没人会帮助你。 http://people.duke.edu/~hpgavin/gnuplot.html

否则,这里有一个示例,说明工作情节如何看起来像命令。

#SET TERMINAL
set term svg
set output 'temp-verlauf.svg'
set title "Temperaturverlauf"

#Axes label
set xlabel "Messzeitpunkt"
set ylabel "Luftfeuchte/Temperatur"
set y2label "Luftdruck"

#Axis setup
set xdata time # x-Achse wird im Datums/Zeitformat skaliert
set timefmt "%d.%m.%Y\t%H:%M:%S" # Format Zeitangaben yyyy.mm.dd_hh:mm:ss
set format x "%H:%M" # Format für die Achsenbeschriftung


#Axis ranges
set yrange [0:60] # die y-Achse geht von:bis

#Tics
set ytics nomirror
set y2tics nomirror

#OTHER
set datafile separator "\t"
set xrange ["06.11.2014 14:00:00":"07.11.2014   21:00:00"]

plot \
"file.dat" every 10 using 1:5 title "Luftfeuchte" with lines, \
"file.dat" every 10 using 1:6 title "Temperatur" with lines, \
"file.dat" every 10 using 1:7 title "Luftdruck" with lines axes x1y2, \
"file.dat" every 10 using 1:17 title "Niederschlagsintensitaet Synop (4677)" with lines

答案3

我猜你的系统中没有存储库和最新的软件包,这就是问题出现的原因。因此,在终端中运行此命令,

sudo apt-get install gnuplot-x11

or

sudo apt-get install gnuplot-qt

这应该可以解决你的问题。(见在此处输入链接描述

相关内容