2016-10-10 5 views
0

私はGnuplotを使って折れ線グラフを作成しようとしています。あなたは空のデータにわたって2つの別々の点を結ぶ直線を見ることができる上記の例で空のデータがある場合にポイントの接続を避ける

enter image description here

:私は次のようなが、例外で何かを取得する必要があります。それは '2016-09-27 00:00:00' xダニを横切るものです。私はその直線の代わりに空白があることを望みます。どうすればこれを達成できますか?

これは、現在のコードです:

set xdata time 
    set terminal pngcairo enhanced font "arial,10" fontscale 1.0 size 900, 350 
    set output filename 
    set key off 
    set timefmt '"%Y-%m-%d %H:%M:%S"' 
    set format x "%Y-%m-%d %H:%M" 
    set xtics rotate by -80 
    set mxtics 10 
    set datafile missing "-" 
    set style line 1 lt 2 lc rgb 'blue' lw 1 
    set style line 2 lt 2 lc rgb 'green' lw 1 
    set style line 3 lt 2 lc rgb 'red' lw 1 

    plot\ 
    fuente using 1:2 ls 1 with lines,\ 
    fuente using 1:3 ls 2 with lines,\ 
    fuente using 1:4 ls 3 with lines 

答えて

0

の3つのオプション:データファイルで

  • は、ギャップがある空行を置きます。この結果、あなたが望むものが得られますが、そのファイルの他のデータにも影響します。
  • everyを使用すると、データの一部をプロットし、ギャップに1回、ギャップから1回、2回プロットするだけです。そして、あなたが使用することができ、ギャップがあなたのケース内のデータポイント42と43の間で発生すると仮定します。

    plot\ 
    fuente using 1:2 ls 1 every ::::41 with lines,\ 
    fuente using 1:2 ls 1 every ::42 with lines,\ 
    fuente using 1:3 ls 2 with lines,\ 
    fuente using 1:4 ls 3 with lines 
    

    every文はコロンで区切られた6つの引数を取りいますが、デフォルト値は空にそれらを残すことができザ・。

  • ファイル内のデータが欠落している場合(set datafile missing "-"で示されているように)、これを有効にするにはusingステートメントを変更する必要があります。

    plot\ 
    fuente using 1:($2) ls 1 with lines,\ 
    fuente using 1:3 ls 2 with lines,\ 
    fuente using 1:4 ls 3 with lines 
    
関連する問題