我有两个文件,其时间为x轴和一个值.我需要在一个图上叠加这两个.目前我尝试使用GNUplot,但在中间打了一针.这是一个示例文件
01:03:05 6
01:03:15 6
Run Code Online (Sandbox Code Playgroud)
和另一个文件
01:03:55 6
01:04:10 6
Run Code Online (Sandbox Code Playgroud)
我需要在一个图中绘制这两个文件(比如x标记和其他一些用于区分的符号).我不知道在GNUplot中是否可以这样做.目前我为每个文件创建了两个网格.但我需要在一个单一的情节中.这是我写的
set multiplot layout 1,2 # engage multiplot mode
set xdata time ## these three lines control how gnuplot
set timefmt '%H:%M:%S' ## reads and writes time-formatted data.
set format x '%H:%M:%S' ##
set xtics 05 # make time spacing of 2 minutes
plot 'AAA' u 1:2 # plot the first data set
plot 'BBB' u 1:2 # plot the second data set
unset multiplot
Run Code Online (Sandbox Code Playgroud)
任何熟悉GNUplot或任何其他工具(在linux中工作)的人都可以帮助我.
为了在单个图中绘制多条线,只需将它们放在单个绘图命令中即可
plot 'AAA' u 1:2, 'BBB' u 1:2
Run Code Online (Sandbox Code Playgroud)
有很多例子可以为你提供gnuplot的良好开端.例如,这个展示了如何在一个图中绘制多条线.
在multiplot您使用的是在你的脚本命令也将有可能有多个图形窗口的显示一样这里.您可以通过以下方式调整每个子图的位置:
set size XSIZE,YSIZE #see `help set size`
set origin XORIGIN,YORIGIN #see `help set origin`
Run Code Online (Sandbox Code Playgroud)
或者(如果您有gnuplot 4.2或更新版本):
set lmargin at screen XMIN #see `help margin`
set rmargin at screen XMAX
set tmargin at screen YMAX
set bmargin at screen YMIN
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
31559 次 |
| 最近记录: |