#1361 strings in plot2d-option `legend'

closed
nobody
5
2008-03-30
2008-02-29
Anonymous
No

In my opinion the following example lines

f(x):=1/(1+x^2);
g(x):=exp(-x^2);
plot2d([f(x),g(x)],[x,-4,4],
[legend,"$\\frac{1}{1+x^2}$","$e^{-x^2}$"]);
plot2d([f(x),g(x)],[x,-4,4],
[legend,"$\\frac{1}{1+x^2}$","$e^{-x^2}$"],
[gnuplot_term,"eepic"],
[gnuplot_out_file,"bug.tex"]);

don't give the expected results:

In the displayed graph, and in the eepic-output, the backslash \ and the beginning dollar $ is missing.
For instance, the output in bug.tex contains the
line

\put(2548,1636){\makebox(0,0)[r]{FRAC{1}{1+X^2}$}}

Another problem is that frac and x get capitalized.

I have been trying out maxima only for a few hours now, however my understanding of `legend' and the handling of strings let me expect a different result, the above output should be

\put(2548,1636){\makebox(0,0)[r]{$\frac{1}{1+x^2}$}}

It does not seem to be a gnuplot problem, because gnuplot handles the analogous construct correctly.

Maxima version: 5.14.0
Maxima build date: 11:54 2/29/2008
host type: i686-pc-linux-gnu
lisp-implementation-type: CLISP
lisp-implementation-version: 2.39 (2006-07-16) (built 3373656864) (memory 3413271278)

Best wishes,
Peter Mueller
(peter.mueller@mathematik.uni-wuerzburg.de)

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Problem is due to src/plot.lisp assuming that Maxima strings are implemented as symbols. I have a patch to fix that which I'll commit in a few days. Robert Dodier (not logged in at the moment)

     
  • Robert Dodier

    Robert Dodier - 2008-03-30
    • status: open --> closed
     
  • Robert Dodier

    Robert Dodier - 2008-03-30

    Logged In: YES
    user_id=501686
    Originator: NO

    Resolved by r1.113 src/plot.lisp. Closing this report as fixed. Corrected version will be in next (5.15.0) release.

    Note that you have to write "$\\\\frac..." to get just \frac in the output. Looks like the string is being processed twice; I would have expected "$\\frac..." should be enough. Not sure if that's a problem.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks