Gnuplot

2021-08-22

  • 1 Basics
    • 1.1 Data
      • 1.1.1 Custom column limiter
    • 1.2 Figure
      • 1.2.1 Save to file
    • 1.3 Axis
      • 1.3.1 Axis range
    • 1.4 Plot
      • 1.4.1 Plot matrix
      • 1.4.2 Line style
  • 2 Advanced
    • 2.1 Configuration
      • 2.1.1 set term x11 fails

1 Basics

1.1 Data

1.1.1 Custom column limiter

set datafile separator ','

1.2 Figure

1.2.1 Save to file

set terminal png size 2048, 1024 font "Cascadia Mono" lw 3
set output 'reysts.png'

1.3 Axis

1.3.1 Axis range

Remember to put the setting before the plot command.

set xrange [0:6.4E-3]

1.4 Plot

1.4.1 Plot matrix

plot 'mat.dat' matrix with image

1.4.2 Line style

Set dt ${number}.

plot 'file.dat' skip 10 using 1:4 w l dt 4 t 'title_name'

2 Advanced

2.1 Configuration

2.1.1 set term x11 fails

gnuplot> set term x11

Terminal type is now 'x11'
Options are ' nopersist enhanced'
gnuplot> Expected X11 driver: /home/jcshi/Softwares/gnuplot-5.2.8/libexec/gnuplot/5.2/gnuplot_x11
Exec failed: No such file or directory
See 'help x11' for more details

It reports that it cannot find the X11 driver. We need to set an environment variable.

export GNUPLOT_DRIVER_DIR=/opt/ohpc/pub/utils/gnuplot/5.2.8/libexec/gnuplot/5.2
gnuplot> set term x11

Terminal type is now 'x11'
Options are ' nopersist enhanced'
.
Created on 2021-08-22 with pandoc