[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: gnuplot: plotting each point in different color



On Thu, Mar 27, 2008 at 21:56:10 -0400, H.S. wrote:
> Florian Kulzer wrote:
>
>> One more thing worth mentioning is that the subroutine trick can also be
>> used to loop over the columns of a dataset (using the "column" command),
>> for example if you have a data file with one common x-axis and 100
>> y-datasets (columns) that you want plot in the same graph. (Or can the
>> plot command do this automatically these days?)
>>
>
> You might be looking for 'using'. Here is an example:
> gnuplot>  plot  "force.dat" using 1:2 title 'Column', \
>                 "force.dat" using 1:3 title 'Beam'
>
> If you have three cols in a force.dat file.

That is indeed fine for three columns or ten, maybe twenty; my point was
that it scales badly to, say, 1000 columns. There are of course other
ways around this, like generating 1000 plot commands with your favorite
scripting language and feeding them to gnuplot, or reformatting the data
file to two columns with a 999-fold repeating x-axis, but these
approaches do not seem any nicer to me than the subroutine-if-reread
hack.

-- 
Regards,            | http://users.icfo.es/Florian.Kulzer
          Florian   |


Reply to: