【问题标题】:How to plot two lines with Torch gnuplot?如何用 Torch gnuplot 绘制两条线?
【发布时间】:2017-07-25 13:30:23
【问题描述】:

我有两个数据集x,yx1,y1。我想将它们全部绘制在一个图中。

require 'gnuplot'

local x,y,x1,y1 = unpack(data)
gnuplot.xlabel('PPL')
gnuplot.ylabel('Epoch #')
gnuplot.plot({x,y},{x1,y1})

这很好用,但我想要直线而不是虚线。另外,我想在右上角包含一个图例。 唉,无论我尝试什么组合,它都不起作用。

gnuplot.plot({x,y},{x1,y1},'-')
gnuplot.plot('1','2',{x,y},{x1,y1},'-')
gnuplot.plot({'1','2',{x,y},{x1,y1},'-'})

如何使用 gnuplot 在一个图中绘制两条线并添加图例?

【问题讨论】:

    标签: lua gnuplot torch


    【解决方案1】:

    根据the docs,以下应该可以工作:

    gnuplot.plot({'first', x, y, '-'}, 
        {'second', x1, y1, '-'})
    

    【讨论】:

    • 不幸的是,它没有。我试过这个符号。
    【解决方案2】:

    torchstyle 变量包含:“set style datalinespoints”,设置数据绘制为linespoints的样式。

    你需要写这个命令:

    gnuplot.raw('set style data lines')
    

    【讨论】:

      猜你喜欢
      • 2011-06-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-10
      相关资源
      最近更新 更多