|
From: Sergei N. <vo...@ra...> - 2017-12-30 05:34:19
|
Thanks a lot, Iva.Tried this but: Terminal type set to 'qt' gnuplot> set datafile separator ";" gnuplot> set table $mydata gnuplot> plot "qq" u (stringcolumn(1)[11:14]):(stringcolumn(1)[16:]) w table ^ x range is invalidgnuplot> Here is the test data one more time: J0023+092311.8D 0.085 J0030+045158.8P 0.861 J0034-0534 6.6D 1.255 -- Sergei 28.12.2017, 20:12, ivana richterova <iva...@mf...>Hi Sergei, although to use external simple filter was intended in such cases, under unix-like OS e.g. "cut": gnuplot> plot '<cut -b 11-14,16- --output-delimiter=" " datafile' you can do this directly by gnuplot as well: # begin gnuplot code # replace datafile with real filename file="datafile" # set the data separator to a char missed in the file set datafile separator ";" # use string functions to extract columns of a given width to a named datablock set table $mydata plot file u (stringcolumn(1)[11:14]):(stringcolumn(1)[16:]) w table unset table # reset the data separator set datafile separator # uncomment to print the preprocessed datablock if you wish # print $mydata # plot the preprocessed datablock plot $mydata w lp t "extracted data" # end of gnuplot code sincerely Iva |