I have a data file, abc.dat and I want to plot it with labeling each coordinate like (1,5), (4,6), (2,8) and so on ....
abc.dat
is like :
1 5
4 6
2 8
4 5
7 8
8 9
3 4
You can write the supersript as X^2, and the subscript is Y_3. To make several letters super- / sub-script, you need brace like Z_{64}. To use super and subscripts at the same time, try Z@^2_{64}. The following is an example to make legends with the superscripts.
To plot functions simply type: plot [function] at the gnuplot> prompt. Discrete data contained in a file can be displayed by specifying the name of the data file (enclosed in quotes) on the plot or splot command line. Data files should have the data arranged in columns of numbers.
5.9 Does gnuplot support multiple y-axes on a single plot? Yes. 2D plots can have separate x axes at the bottom (x1) and top (x2), and separate y axes at the left (y1) and right (y2).
Use the labels
plotting style for this. That requires three using
specifiers: x-value, y-value and a string which is placed at the given coordinates. So the easiest command would be:
plot 'abc.dat' using 1:2:(sprintf("(%d, %d)", $1, $2)) with labels notitle
That places the respective labels centered at the coordinates.
The following command plots a point at the respective coordinate and places the coordinate label a bit shifted near to it:
set offset 1,1,1,1
plot 'abc.dat' using 1:2:(sprintf("(%d, %d)", $1, $2)) with labels point pt 7 offset char 1,1 notitle
The result with 4.6.4 is:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With