Try Pangolin (5) - SimplePlot

Structure DataLog is defined in plotter.h:

  // Data logger object
  pangolin::DataLog <span style="color:#3366FF;">log</span>;



To name labels:
  // Optionally add named labels
  std::vector<std::string> labels;
  labels.push_back(std::string("sin(t)"));
  labels.push_back(std::string("cos(t)"));
  labels.push_back(std::string("sin(t)+cos(t)"));
  <span style="color:#3366FF;">log</span>.<span style="color:#CC0000;">SetLabels</span>(labels);


About pangolin::Plotter:

  // OpenGL 'view' of data. We might have many views of the same data.
  <span style="color:#3333FF;">pangolin::Plotter</span> plotter(&log,0,4*M_PI/tinc,-2,2,M_PI/(4*tinc),0.5);
  plotter.SetBounds(0.0, 1.0, 0.0, 1.0);
  plotter.<span style="color:#FF0000;">Track</span>("$i");


And nothing changed after commenting out log.Track("$i");


Let's compare the result and the values:

Result:

As shown in this plot:

The "top", "bottom", "left" and "right" are in accordance with the given values.

"tickx" and "ticky" are the smallest units of x and y axis.


Compare the difference between Display and DisplayBase:

  pangolin::<span style="color:#009900;">DisplayBase</span>()
	.AddDisplay(plotter);

pangolin::Plotter plotter(&log,0,4*M_PI/tinc,-2,2,M_PI/(4*tinc),0.5) is the base of the whole display,

while:

    pangolin::DataLog log;
    ...
    log<strong><span style="color:#CC0000;">.Log</span></strong>(sin(t),cos(t),sin(t)+cos(t));
    t += tinc;
    (.Log) defines the curve.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值