|
From: Ethan A M. <merritt@u.washington.edu> - 2009-03-12 05:53:06
|
On Wednesday 11 March 2009, Mojca Miklavec wrote: > On Mon, Mar 9, 2009 at 17:46, Juergen Wieferink wrote: > > > >> May I request adding a simple example like this (using for loop and > >> "title column()") to > >> http://gnuplot.sourceforge.net/demo/datastrings.html > >> ? > > > > From the code, > > > > plot ... title column(<int expr>) > > > > does more or less the same as > > > > plot ... title <int const> > > > > The command > > > > plot ... title column > > > > without following "(" tries to guess which column to fetch data > > from, which in this case might be exactly what you want. I do not > > like that "column" has two different meanings. > > > > As soon as it is documented or in the demos, this can never be > > changed. > > One more question. I know that the order of reading parameters is a > pretty sensitive issue in gnuplot, but it nevertheless confused me > that > plot for [n=2:5] 'data.dat' using 1:n title column with lines > plot for [n=2:5] 'data.dat' using 1:n with lines title "something" > both work while > plot for [n=2:5] 'data.dat' using 1:n with lines title column > fails. Is that behaviour "compatible" with previous and future > versions of gnuplot? It is all part of the same problem. The code that implements the 'using ... title column(foo)' option is an ugly hack. It is a known bug, and has been on the list of things to fix for a long time. The reason it persists as a sore point rather than being fixed immediately is that in order to work properly it needs information that is only visible inside the datafile.c routines, whereas normally command options are parsed elsewhere. To fix it we will have to rearrange the code, and/or introduce new global variables, etc. > Also, I miss a bit two things. The first one being something like > set format title "$a=%.2f$" > or some other way to transform title. > > Let's say that legend (first line in data file) looks like > 0.001 0.1 1 1.5 2 2.5 > and that I want to use the third to sixth column and generate > $a=1,0$ $a=1,5$ $a=2,0$ $a=2,5$ > as the title for some LaTeX terminal. I know that I can change the > label myself, but I cannot control the data and should make copies of > it first. I got used to be able to change > set format y > so much that I sometimes want to misuse way it above its limits. Sorry, I didn't understand that. Could you try again? Are you talking about the plot title, the key entries, tick labels, or what? Anyhow, I suspect the answer in no, there is no way to do that. > The second question: is there a way to say something like > for [n=2:4,6,8:20,25,30:40] > ? (I know that I can construct it myself from several commands, but > the for loop is really practical for long expressions that repeat > themselves anyway.) That you can do: for [i in "2 4 6 8 9 10..."] Although this is a string, so long as the component 'words' are pure numbers the code should auto-convert back to integers when needed. This feature has not been extensively tested, I suspenct. So if you have problems, please complain. > Thanks a lot, > Mojca > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |