2012-02-19 129 views
0

的直方图是否可以在gnuplot中绘制[v(1); ...; v(i-1); v(i)]这样的矩阵(直方图)。这是stringstream的标准输出< < cv :: Mat()。这是色相值0到180的y值。Gnuplot,Opencv。显示cv :: Mat

[25; 0; 0; 0; 0; 0; 1; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 4; 0; 0; 0; 5; 0; 0; 0; 0; 0; 16; 0; 0; 0; 0; 0; 3; 0; 0; 0; 4; 0; 10; 0; 0; 1; 0; 0; 4; 0; 37; 3; 3; 0; 0; 11; 10; 7; 0; 0; 47; 0; 0; 16; 0; 18; 91; 8; 41; 34; 101; 22; 15; 149; 223; 45; 94; 25; 0; 312; 745; 53; 28; 166; 413; 253; 47; 682; 144; 63; 630; 48; 92; 222; 3; 253; 175; 1; 62; 7; 1; 80; 0; 40; 9; 0; 1; 0; 0; 2; 12; 0; 0; 0; 9; 1; 0; 0; 0; 0; 2; 0; 0; 0; 0; 0; 5; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 7; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]

有关如何为gnuplot显示数据的简短指南将很好。

回答

1

您有几种选择 (1)使用GNUPLOT-CPP包装(点击这里下载:http://code.google.com/p/gnuplot-cpp/) 这将指导本身通过其教程/文档

(2)简单的解决方案。保存价值的文件,说“DATA.TXT”然后调用,从CPP(exec命令),如“plot.plt”脚本它看起来像:

#!/usr/bin/gnuplot -persist 

set terminal postscript 
set output "TXTFILE.ps" 
unset key 

#set title "Titel" 
set xlabel "cy/px" 
set ylabel "SFR" 
(...) 
set grid 

plot "DATA.txt" using 1:2 smooth csplines w l ls 1,\ 
    "DATA.txt" using 3:4 smooth csplines w l ls 2 
# EOF 

正如你所看到的,它会绘制您刚刚输出的DATA.txt。使用谷歌gnuplot脚本f.e.上的所有以前的。

相关问题