7

I have an archive "curva-l" with the data:

2.308E-05   5.397E-01     1.0E-09  
2.318E-05   5.224E-01     1.0E-08
2.426E-05   5.029E-01     1.0E-07 
4.012E-05   4.718E-01     1.0E-06
1.311E-04   4.155E-01     1.0E-05
3.751E-04   3.703E-01     1.0E-04
1.306E-03   3.197E-01     1.0E-03

The first column is the axis X, the second Y, and the third is the value of each point. I would like to plot this curve with lines and label each point with the their respective value.

Like this one

1

2 Answers 2

6

It depends on the gnuplot version you have.
There are many example [1,2,...] you can start with. Take inspiration from the demos.

The style of the image you shown is linepoints, and you can plot the labels with the keyword with label.
You can print 2 times the same dataset, one with the linespoints, and the second with the labels.

Start with

plot "data.dat" w linespoint , '' with labels

and give it a look. After find the offset you prefer.
The following code

set xlabel "My X Axes"
set ylabel "My Y Axes"
plot "data.dat" with  linespoint lw 2 pt 11 \
   , ''        with labels center offset 3.4,.5 notitle

gives you this image

Plot of the code

In a second time you can modify the xrange, yrange... add logarithmic scale...

3

Or in a single command:

< /tmp/dat awk '{print $1,$2,$2,$3}' | feedgnuplot --domain --style 0 'with lines' --style 1 'with labels' --rangesize 1 2 --set 'logscale x' --set 'logscale y'
1
  • 6
    Please elaborate your answer: Explain what feedgnuplot is and what part of that command actually solves the asker’s problem.
    – Wrzlprmft
    Dec 4, 2015 at 12:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .