如何在gnuplot中绘制缺少数据点的线 [英] How to plot line with missing data points in gnuplot

查看:107
本文介绍了如何在gnuplot中绘制缺少数据点的线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

示例:

我想像上图一样绘制一个图表:一条线缺少一些数据点,这意味着该线是不连续的.

I want to plot a chart just like above one: a line with some missing data points, that means the line is discontinuous.

我该怎么做?

推荐答案

这取决于您的数据文件的外观.如果在数据文件中插入空格,它将不会连接那些相邻的点(这是最简单的方法):

This depends on what your datafile looks like. If you insert a blank space in your datafile, it won't connect those adjacent points (This is the easiest way):

考虑:

 #datafile
 1 2
 2 3

 4 2
 5 3

,然后是绘制它的脚本:

and then the script to plot it:

 plot 'datafile' u 1:2 w linespoints

您还可以使用其他技巧来处理丢失的数据:set datafile missing.内置帮助(help missing)是一个很好的参考.

There are other tricks you can play with missing data: set datafile missing. A good reference for this is the builtin help (help missing).

这篇关于如何在gnuplot中绘制缺少数据点的线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆