0

I have this gnuplot script:

f(x) = 5 * log(x) / log(2) - 5 - sqrt(5 + x) 
F = '$5 \log_2(x) - 5 - \sqrt{5 + x}$'

set yrange [0:30]
set xrange [0:3000]

set terminal epslatex size 10.0cm,10.0cm color colortext
set output 'RunTimeComparisonTreeIndexed.tex'

set style line 1 linecolor rgb "#ff6666" linetype 1 linewidth 5

plot f(x) title F  with lines ls 1

replot
exit

I get an .eps file that looks like this: Unfunky eps

So what I want to achieve, is typesetting the LaTeX expression in the gray legend box instead of a duplicate expression in Monospaced.

4
  • It works here. Which version of Gnuplot are you using?
    – Thor
    Oct 19, 2022 at 12:07
  • @Thor gnuplot 4.6.7
    – coderodde
    Oct 19, 2022 at 12:37
  • @Thor I also tried 5.4.4, yet it produced the same result for me.
    – coderodde
    Oct 20, 2022 at 4:04
  • @Thor Could you show me your output via, say, Imgur?
    – coderodde
    Oct 20, 2022 at 6:59

1 Answer 1

1

This works here with the following script (only added standalone to set terminal):

generate_tex.gp

f(x) = 5 * log(x) / log(2) - 5 - sqrt(5 + x)
F = '$5 \log_2(x) - 5 - \sqrt{5 + x}$'

set yrange [0:30]
set xrange [0:3000]

set terminal epslatex standalone size 10.0cm,10.0cm color colortext
set output 'RunTimeComparisonTreeIndexed.tex'

set style line 1 linecolor rgb "#ff6666" linetype 1 linewidth 5

plot f(x) title F  with lines ls 1

Run:

gnuplot generate_tex.gp
pdflatex RunTimeComparisonTreeIndexed.tex

Result:

1
  • Works like charm! Thanks!
    – coderodde
    Oct 20, 2022 at 11:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .