|
From: Jian-Ming Z. <jm...@gm...> - 2013-08-23 02:22:23
|
Hi, Thanks for the reply. I have tried "smooth unique," but it did not work for me. For example, the data file is shown as follow. 1 10 2 15 3 1 4 15 5 30 I want plot column 2 as y values in order of the values. That is, the first y value is 30, the second y value is 15, the third value is 15, and so on. I can do so by sorting the file by column 2. The file is sorted as follows. 5 30 2 15 4 15 1 10 3 1 Then I plot the sorted file by using: plot 'datafile' using 2 w linespoints Please kindly let me know how to use "smooth unique" to do so. Thanks. On Fri, Aug 23, 2013 at 4:33 AM, Hans-Bernhard Bröker <HBB...@t-...> wrote: > On 22.08.2013 09:54, Jian-Ming Zheng wrote: >> >> Hi, >> >> I have a data file which contains several columns. The data in the >> file are not sorted. I want to sort the data of a column (for example, >> column 3) and plot the data. I use UNIX command sort to sort the data >> and then use gnuplot to plot the data. >> >> $ sort -k3nr datafile > sortfile # sort column 3 in decreasing order >> gnuplot> plot 'sortfile' u 3 w linespoints # plot sorted values of >> column 3 at x = 0, 1, 2, … >> >> Is it possible to directly sort the data and plot the results in >> gnuplot? If yes, how to do it? > > > See "help smooth", then "help smooth unique". > > |