How do I convert an integer to a string in gnuplot?

后端 未结 5 2163
别跟我提以往
别跟我提以往 2021-02-14 05:14

I know how to use $ with using in examples like

plot datafile using f($1):g($2)

to plot functions of column data. But

5条回答
  •  感情败类
    2021-02-14 05:37

    Prepend an empty string if necessary. E.g.:

    gnuplot> a=42
    gnuplot> print a." questions"
             internal error : STRING operator applied to non-STRING type
    
    gnuplot> print "".a." questions"
    42 questions
    

    The first print fails because of a type mismatch. The second one works fine though. Apparently . is left associative.

提交回复
热议问题