How to “set format x” to have the format valid with gnuplot+cairolatex

My gnuplot.plt is set up like this

set term cairolatex pdf
set output "data.tex"
set nokey
plot 'data.csv' using 1:2 with lines,


And I use the output from gnuplot in my latex like this

\begin{figure}
\input{data.tex}
\end{figure}


Which works fine and valid when compiles with lualatex, but if I add

set format x "%.0s 10^%S"


The generated data.tex gives this error when compiled

! Missing $inserted. <inserted text>$
l.129     \gplbacktext


I did try to put  around the \gplbacktext and the format-string, but that changed nothing.

• This is a problem of single vs. double quotes then. set format x '$$%.0s \times 10^%S$$' works perfect for me, as does set format x "\$$%.0s \\times 10^%S\$$"`. – Henri Menke Mar 25 '18 at 2:41