2016-11-17 66 views
-1

我有一個CSV文件是這樣的:如何選擇將哪個列放置在軸上的標籤?

10557,1925080,1236052,1210752,1182492 
11254,3159084,2264460,2187584,2144416 
11334,2348036,1540692,1504536,1458332 
11456,1607704,993228,974676,960308 
..... 

我要創建這些數據的圖表。我想使用第一列作爲x軸標籤,並將所有其他列像圖表中的不同行一樣放入。我該怎麼做?

這是我的代碼

set terminal pngcairo enhanced font "arial,10" fontscale 2.0 size 1680, 1024 
set size 1,1 
set ylabel '[y]' 
set xlabel '[FIRST COLUMN FROM CSV]' 
set datafile separator "," 
set autoscale fix 
set key top left 
set key box 
set output 'Figure1.png' 
plot \ 
"figure1.csv" using 2 w l linewidth 3 lc rgb "black" title "second colum", \ 
"figure1.csv" using 3 w l linewidth 3 lc rgb "black" title "third colum", \ 
"figure1.csv" using 4 w l linewidth 3 dashtype 2 title "fourth colum", \ 
"figure1.csv" using 5 w l linewidth 3 dashtype 5 title "fifth colum" 

回答

0

爲了得到均勻的x軸線隔開抽動其中獲得標記與來自第一列中的值使用xticlabels

plot "figure.csv" using 0:2:xticlabels(1) 
相關問題