gnuplot -e 'set terminal pngcairo; set output "lab.png"; set title "Age vs Salary"; set xlabel "Age"; set ylabel "Salary"; set datafile separator ","; plot "data.csv" using 2:4 with lines'
gnuplot -e 'set terminal pngcairo; set output "lab.png"; set title "Age vs Salary"; set xlabel "Age"; set ylabel "Salary"; set datafile separator ","; plot "data.csv" using 2:4 with lines'
Plot with a title and labeled axes
The set title, set xlabel, and set ylabel commands annotate the chart, here labeling a plot of age against salary. Labels are essential when the chart will be read by others or published. The -e string can hold any number of set commands separated by semicolons. This is the base template for presentation-ready gnuplot output.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.