datatablegnuplotdata-filesdollar-sign

How to generate a three column data file in gnuplot


its my first question in this community. I am running the following short script in gnuplot (5.2),

set table "testable.txt" plot '+' using 1:($1**2):($1**3) unset table

The resulting data file contains only two columns; first a series of numbers from -10 to 10, and second their squares (as expected), but the third column (which should be the cubes of entries in first column) is missing. How can I get that third column in my data file?


Solution

  • Use with table. Check help plot with table.

    set table "testable.txt"
    plot '+' using 1:($1**2):($1**3) with table
    unset table