我有一个像这样的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 :(得分:0)
要在x轴上获得均匀间隔的抽搐,使用xticlabels
标记第一列中的值:
plot "figure.csv" using 0:2:xticlabels(1)