The attached gnuplot code runs correctly under gnuplot 5.2 patchlevel 8 and produces a plot (GnuplotBug.png) ut fails in gnuplot 5.4 patchlevel 0.
show version set terminal pngcairo OutputPlot = sprintf("GnuplotBug.png") set output OutputPlot set title sprintf("gnuplot % 4.1f patchlevel %s ",GPVAL_VERSION,GPVAL_PATCHLEVEL) plot ARG1 using ($1):2
When run from a command shell terminal window thus:
gnuplot -c plot.gp data.txt
at line 12 in the attached plot.gp gnuplot script:
Version 5.2 sees the value $1 and the script produces attached GnuplotBug.png output correctly.
Version 5.4 does not see value $1 and the script fails. thus:
G N U P L O T Version 5.4 patchlevel 0 last modified 2020-07-13 Copyright (C) 1986-1993, 1998, 2004, 2007-2020 Thomas Williams, Colin Kelley and many others gnuplot home: http://www.gnuplot.info faq, bugs, etc: type "help FAQ" immediate help: type "help" (plot window: hit 'h') **plot ARG1 using ():2 ^ "plot.gp" line 6: invalid expression**
Thank you for the bug report and the excellent reproducer.
This failure in 5.4.0 has the same cause as reported in https://sourceforge.net/p/gnuplot/bugs/2298/
although this manifestation is more serious because I can't think of an easy work-around.
The fix will be in 5.4.1, to be released soon (next month?)
I see. (I submitted the bug report.) I found that replacing $1 with $$1 causes the script to function correctly with gnuplot 5.4.0. I hope that future releases are subject to some set of standard regression tests.