1
votes

I'm writing a mathematical course in LaTeX. For plotting, we use Maxima-Gnuplot. I have a perfect working graph. The label is supposed to contain the formula. The plot I'm using:

sw_draw("
color=\"midnight-blue\",
line_width=2,
explicit(sqrt(x),x,0,5),
yrange=[-5,5],
xrange=[-2,5],
xaxis = true,
yaxis=true,
color=\"midnight-blue\",
label ([\"f(x)={/Symbol @\326\140}x\",-1,2])
")

I've read that the label should contain the 326 for the rootsignbase, and the 140 for the line of the root in the top. I already tried:

  • $\sqrt{x}$, which is not working.
  • multiple \

Did someone solve this before? I've read through all forums.

1
I have no idea what Maxima-Gnuplot is, but in gnuplot+latex single quotes are usually a less involved solution than double quotes, e.g. set xlabel '$\sqrt{x}$'. Maybe you can try that. - Miguel
Thank you, tried that as well... Did not work. - lilienfa
I don't understand why all of the arguments are concatenated into a string. What is the function sw_draw? What interface are you using? What is the content of the Gnuplot output file (maxout.gnuplot or maxout.gnuplot_pipes)? Can you edit the Gnuplot output file to get the display you want? (That would give us a clue as to how to adjust the arguments in Maxima.) - Robert Dodier
I'm guessing that sw_draw prints the string to generate a Maxima expression. If so I'm guessing you can try this: put four backslashes in each place that you want a backslash in the label string, i.e.: label ([\"f(x)={/Symbol @\\\\326\\\\140}x\",-1,2]) - Robert Dodier
@RobertDodier thank you for your comment. It did not work though. output file is in maxima.gnuplot. I'm fairly new to this. But here is a link about maxima plots: riotorto.users.sourceforge.net/gnuplot/index.html I did solve it, in a way similar to your tip! - lilienfa

1 Answers

0
votes

We managed to solve the problem. Did write it in different way:

user_preamble=\"set label 'f(x)={/Symbol @\\\\326\140}x' at -1,2\"