从C程序与gnuplot交互。如何键入要打印的数组

从C程序与gnuplot交互。如何键入要打印的数组,c,gnuplot,C,Gnuplot,我试图使用gnuplot制作嵌入到C应用程序中的“实时”绘图,但我遇到了一些需要更改的问题 我习惯于与gnuplot“接口”,就像我在终端中使用gnuplot一样。 每当我打印(两行)时,我都会将数据保存到一个文件中,然后告诉gnuplot加载文件并打印 我希望不必保存数据文件并将数据直接加载到gnuplot中。我对gnuplot了解不多,所以可能有一个简单的解决方案来满足我的需求。我希望有这样一个命令: plot [1,2,3,4], [1,1,1,1], [1,2,3,4], [2,2,2,

我试图使用gnuplot制作嵌入到C应用程序中的“实时”绘图,但我遇到了一些需要更改的问题

我习惯于与gnuplot“接口”,就像我在终端中使用gnuplot一样。 每当我打印(两行)时,我都会将数据保存到一个文件中,然后告诉gnuplot加载文件并打印

我希望不必保存数据文件并将数据直接加载到gnuplot中。我对gnuplot了解不多,所以可能有一个简单的解决方案来满足我的需求。我希望有这样一个命令:

plot [1,2,3,4], [1,1,1,1], [1,2,3,4], [2,2,2,2]
     |_____line 1_______|  |______line 2______|
在gnuplot中是否有这样做的方法?

gnuplot>help-datablock
gnuplot> help datablock
 There are two mechanisms for embedding data into a stream of gnuplot commands.
 If the special filename '-' appears in a plot command, then the lines
 immediately following the plot command are interpreted as inline data.
 See `special-filenames`.  Data provided in this way can only be used once, by
 the plot command it follows.

 The second mechanism defines a named data block as a here-document.  The named
 data is persistent and may be referred to by more than one plot command.
 Example:
      $Mydata << EOD
      11 22 33 first line of data
      44 55 66 second line of data
      # comments work just as in a data file
      77 88 99
      EOD
      stats $Mydata using 1:3
      plot $Mydata using 1:3 with points, $Mydata using 1:2 with impulses

 Data block names must begin with a $ character, which distinguishes them from
 other types of persistent variables.  The end-of-data delimiter (EOD in the
 example) may be any sequence of alphanumeric characters.
将数据嵌入gnuplot命令流有两种机制。 如果特殊文件名“-”出现在plot命令中,则行 紧接着plot命令的数据将被解释为内联数据。 请参阅“特殊文件名”。以这种方式提供的数据只能使用一次 它后面的plot命令。 第二种机制将命名数据块定义为here文档。命名的 数据是持久的,可以由多个plot命令引用。 例子: $Mydata
gnuplot>help数据块
将数据嵌入gnuplot命令流有两种机制。
如果特殊文件名“-”出现在plot命令中,则行
紧接着plot命令的数据将被解释为内联数据。
请参阅“特殊文件名”。以这种方式提供的数据只能使用一次
它后面的plot命令。
第二种机制将命名数据块定义为here文档。命名的
数据是持久的,可以由多个plot命令引用。
例子:
$Mydata