我的"file.txt"文件中的数据如下所示(显示的示例行)
31 1772911000 6789494.2537881
Run Code Online (Sandbox Code Playgroud)
请注意,第二列是平均值,第三列是我输入样本的标准偏差.因此,对于误差条,我需要x轴值为31的条形,误差条从(第二列值)开始 - (第三列值),并以(第二列值)+(第三列值)结束).我尝试了以下方法:
plot "file.txt" using ($1-$2):1:($2+$1) with errorbars
Run Code Online (Sandbox Code Playgroud)
但结果不合适.有帮助吗?
我使用的gnuplot的splot函数显示了x,y和z轴的不同比例.因此,最终的图通常沿着一个轴拉伸.我怎么能指定我想要沿三个轴都有相同的比例?
我读到'set size square'在2D中完成工作,但我想知道如何用splot(3D)实现这一点.
为了在C中尝试C++代码包装,我使用了以下内容:header.h
#ifdef __cplusplus
extern "C"
#endif
void func();
Run Code Online (Sandbox Code Playgroud)
source.cpp
#include "header.h"
#include <iostream>
extern "C" void func()
{
std::cout << "This is C++ code!" << std::endl;
}
Run Code Online (Sandbox Code Playgroud)
和source.c
#include "header.h"
int main()
{
func();
}
Run Code Online (Sandbox Code Playgroud)
为了编译和链接,我使用了以下序列:
g++ -c source.cpp
gcc source.c source.o -o myprog
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:从std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
source.cpp:(.text+0x1c): undefined reference tostd :: basic_ostream> :: operator <<(std :: basic_ostream>&(*)(std :: basic_ostream>&))'source.o:在函数__static_initialization_and_destruction_0(int, int)':
source.cpp:(.text+0x45): undefined reference tostd :: ios_base :: Init :: Init()'source.cpp …
我在使用gnuplot渲染除了一条线以外的所有线条时都遇到了麻烦.即,设定后
gnuplot> set terminal postscript eps color
gnuplot> set term postscript eps color linewidth 2
gnuplot> set output "local1.eps"
gnuplot> set pointsize 0.5
Run Code Online (Sandbox Code Playgroud)
和调用
plot "YY_globalized.txt" using 1:2 title "Global approach" with linespoints linetype 1 pointtype 1, "YY_localizedPlain.txt" using 1:2 title "Localized Opt" with linespoints linetype 11 pointtype 2
Run Code Online (Sandbox Code Playgroud)
一条线是实线,而另一条线是虚线.在多行的情况下,每个都有自己的风格,不同于虚线.有没有办法指定所有的行应该是实心的,但是颜色不同(并且可能有不同的点样式)?
谢谢.