Search code examples
plotgnuplotpoints

Gnuplot: how to plot single points with custom xlabels


my problem is the following, I have a text file like that:

#X,#Y 
1,1.00182349
2,4.024570000000001
3,8.73499

What I want to get is a plot like that:

enter image description here

where, basically, each y value is plotted as distinct point and on the x-axis my label are N,L,H.

I made that picture with the plot command in octave, but I'm forced to do that with gnuplot.

Please, can someone tell me how to do that?

Thanks.


Solution

  • You can specify arbitrary label for the tic labels:

    set datafile separator comma
    set logscale    y
    set xtics ("N" 1, "L" 2, "H" 3)
    plot "test.dat" using 1:2:1 notitle with points linecolor variable pointtype 5 pointsize 2
    

    enter image description here