2014-10-04 64 views
1

我有一個關於gnuplot的新問題。我有專欄,有時在專欄有價值的地方,有時候沒有。是否可以使標籤文本的偏移量有條件,請參閱白色值的示例?如何在gnuplot中創建條件偏移量?

part of gnuplot graphics

我試着用:

"<tail -60 p1_en_gr2.txt" u 1:11:($11>0 ? $11 : sprintf("")) w labels left rotate font ",10" tc rgb "#00b900" ($11>250 ? offset 0 : offset -2) notitle,\ 

這是行不通的。這有什麼竅門嗎?

回答

1

我認爲這是不可能的。但是你可以寫

..u 1:11:($11>250 ? $11 : sprintf("")) w labels left rotate font ",10" tc rgb "#00b900" offset 0 notitle, 
'' u 1:11:(($11<250 && $11>0)? $11 : sprintf("")) w labels left rotate font ",10" tc rgb "#00b900" offset -2 notitle,\ 
... 

所以你把它分成一個圖的值爲0 ... 250和一個圖爲較大的值。

+0

[結果圖片](http://i.stack.imgur.com/CwLCS.png)使用此代碼的OP。 – Christoph 2014-10-05 10:04:06