|
From: Lars H. <la...@ho...> - 2007-02-05 13:31:23
|
Hi! > How can I plot a graph of alphabetical data (for e.g. > R,H,T) in x-axis vs numerical data in y-axis using > gnuplot? What will be the format of input file (i.e .dat > file) ? Can this be done with Gnuplot? gnuplot is able to read operate with any ASCII-datafile. Usually gnuplot supposes, that datapoints in an input-file are written in lines, with white spaces as seperator for the columns. Other ways can be set. Read "help datafile" and its subtopics for more detailled information. I suppose you want the alphabetical data for the x-axis to be sorted. Unfortuanetly gnuplot does not support this (yet?). It needs all inputs to be double-precision floats. So you have to tell gnuplot, which alphabetical character/word belongs to which position on the x-axis. The simliest way of doing this would be to add a new column to your datafile which contains numerical "translations" of your alphabetical data and use this column as x-value. See "help using" for more information. Another way might be to sort the lines of your datafile externally by the values of the alphabetical data. Then you might use the special value "-1" within the using-option, which tells gnuplot to use the line number of the datafile as x-value. As a consequence of the need of numerical input, gnuplot automatically marks the tics of the x-axis with numerical values. If you would like to change this, you'd have to set the tic-markers by hand. "help xtics" tells you how to do that. Regards Lars P.S.: I strongly recomend an update to version 4. It should be availabe as RPM on the usual file-servers. |