有人可以帮助我.我正在尝试创建一个简单的图表.
set datafile separator ","
set xdata time
set timefmt "%d/%m/%Y %H:%M:%S"
set format x "%H:%M"
set autoscale y
plot ["13:00":"14:00"] './data.csv' using 1:2 with lines
Run Code Online (Sandbox Code Playgroud)
data.csv:
26/10/2010 13:30:01,1
26/10/2010 13:30:12,2
26/10/2010 13:30:23,3
26/10/2010 13:30:34,4
Run Code Online (Sandbox Code Playgroud)
给我错误:
line 6: all points y value undefined!
Run Code Online (Sandbox Code Playgroud)
我已经尝试过timefmt设置的所有方式!
非常感谢
我不想在这里做任何想象.我试图在以下脚本中自动绘制一些实验数据:
print "processing: ", filename
gnuplot = Popen(gnuplot_bin,stdin = PIPE).stdin
if state_plot:
gnuplot.write( "set term x11\n".encode())
gnuplot.write( "set term png size 1920,1010 \n".encode() )
gnuplot.write( "set output \"acceleration.png\" \n".encode() )
gnuplot.write( "set xlabel \"timesteps\" \n".encode() )
gnuplot.write( "set ylabel \"acceleration\" \n".encode() )
gnuplot.write( "plot " %filename " using 1 with lines lt -1 lw 0.5 title 'X axis' \n " .encode() )
gnuplot.write( " " %filename " using 2 with lines lt 1 lw 0.5 title 'Y axis' \n " …Run Code Online (Sandbox Code Playgroud) 我有一组具有相同2列格式的csv文件.我想生成与每个文件对应的单独的xy散点图,但具有相同的样式.唯一应该改变的是输入和输出文件名.怎么做?
我正在使用gnuplot制作彩色地图.我需要的是,当我设置调色板时,我需要定义范围和颜色,以便某些范围具有相同的颜色.
例如,假设数据的第三列范围从100到150.我需要100到120是相同的颜色,然后是120到130相同的颜色.我试过这样做
set palette defined (100:120 "gray", 121:129 "blue", 130:150 "dark-gray")
Run Code Online (Sandbox Code Playgroud)
但是gnuplot说这是无效的表达,特别是指向" : ".
有没有办法解决?
嘿家伙我正在尝试做一个真正的热图,就像在R中 的真实热图,但是在GNUPLOT中.
我的档案就像
3 1 2
3 4 3
3 5 5
4 1 7
4 1 2
4 4 3
4 5 2
5 1 3
5 1 2
5 4 3
.
..
....
Run Code Online (Sandbox Code Playgroud)
我试过了
用图像1:2:3绘制"文件"
用1:2:3 p3md绘制"文件"
等等..
我也遵循这个例子http://gnuplot.sourceforge.net/demo/heatmaps.html,但没有.
有人可以在这里说清楚吗?
谢谢
我有两列的数据文件
10 0.5
20 0.8
25 0.3
15 0.6
Run Code Online (Sandbox Code Playgroud)
如果第一列小于或等于20,我想绘制第二列。问题是,我想跳过第一列大于20的行,但是gnuplot迫使我在条件部分中做一些事情。
该命令是
plot 'data.txt' u ($1<=20?$2:0) with points
Run Code Online (Sandbox Code Playgroud)
如您所见,我必须指定一个零点。我不要那个!我想跳过...
我有几千个绘图点(大约10k),我想用Matlab绘制它们,但是为每个点确定不同的大小(如果可能的话,还有不同的颜色).我尝试为每个点制作散点图,但与所有点的单个散点调用相比,它非常慢.有没有办法在Matlab中绘制几个点,每个点的不同属性,在合理的时间内工作?
如果用Matlab无法做到这一点,有没有办法用gnuplot来做?
我想用C++绘制热图,我遇到了这个代码:用C++中的Gnuplot绘制热图
总而言之gp.send2d(frame);,send2d看到的函数是float*,那么它如何知道尺寸(4x4)?或者甚至可以安全地访问16个元素?
我通常tikz-pgfplot通过gnuplot-lua界面来绘制研究论文的科学数据.它通常非常好,我可以将我的数字无缝地整合到latex文档中.由此产生的数字是非常高的分辨率和精细的.然而,绊脚石是大数据集的高分辨率散点图 - 调整100,000点.
如果我按照我的惯常tikz-pgfplot路线latex生成文件,但在编译时pdflatex,会得到tex memory exceeded...错误.我也知道增加tex记忆并不是一个好主意.所以,我最终生成了一个eps(封装的postscript)图,然后我将其包含在我的latex文档中tikz-pgfplot以呈现注释.它通常可以工作,但会产生一个非常大的PDF文件,2 MB以便为一个小图而且PDF读者需要很长时间才能完全显示图形.
我想知道,是否还有其他方法可以生成大型数据集的高分辨率散点图?任何指针都将受到高度赞赏.
Madhur
我正在运行以下脚本:
#!/bin/bash
gnuplot -e "set t latex ; set size 0.5,1; set output 'grafico.tex';
set xtics ('$\frac{-\pi}{2}$' -pi/2, 0, '$\frac{\pi}{2}$' pi/2); set xrange [-pi/2:pi/2];
set yrange [-2:2]; set ylabel '$ f(x)$'; set xlabel '$\theta$';
plot sin(x); pause -1 'hit return to continue'"
pdflatex latex
atril latex.pdf
Run Code Online (Sandbox Code Playgroud)
输出1
作为编程和gnuplot的初学者,我想确保这是正确的方法.我的怀疑来自输出,它看起来不太好(主要是分辨率).我有什么简单的改进吗?任何改进以改善绘图技术和提高结果都将受到欢迎.
输出2
更改latex到cairolatex pdf作为建议@Ethan梅里特的回报:
这要好得多.