|
From: <she...@be...> - 2010-05-21 17:24:44
|
Great! Thank you. > > it would be best, if you could insert 2 blank lines between > two matrices, e.g.: > > datafile.dat: > 19 27 > > 22 43 67 70 > 12 76 19 102 > 43 78 93 23 > 67 9 28 56 > > > 17 24 > > 12 33 47 50 > 22 46 39 42 > 33 58 23 33 > 47 19 18 26 > > then you would do the dummy plot to set the variables: > > set term push > set term dumb > plot 'datafile.dat' index 0 every ::0::0 using (a1=$1, a2=$2, 0/0):(0/0), > \ > '' index 1 every ::0::0 using (b1=$1, b2=$2, 0/0):(0/0) > set term pop > show variables > # and now the matrix plots > splot 'datafile.dat' matrix index 1 with linespoints, '' matrix index 3 > with > linespoints > > note that the 'index' numbering is different for normal and for matrix > plots. > to avoid this you could insert double blank lines between the numbers for > reading into the variables and the matrices too. > > > SHELTRAW, DANIEL wrote: >> >> Hi Thomas >> >> A file would look something like this >> >> 19 27 >> >> 22 43 67 70 >> 12 76 19 102 >> 43 78 93 23 >> 67 9 28 56 >> >> Actually this pattern of two numbers on a line followed by a matrix of >> data would repeat throughout a larger file. What I need is to plot the >> matrix of data as a 2D image and label that image according to the two >> numbers contained on the line that precedes the matrix data. However I >> could change the format if it would help me achieve this. >> >> Thanks again for your help. >> >> >>> >>> do a dummy plot to read the data in and assign the values to >>> the variables inside the 'using' option. >>> >>> for more details please post information about how your data >>> file looks like. >>> >>> >>> SHELTRAW, DANIEL wrote: >>>> >>>> Hi Gnuploteers >>>> >>>> I would like to be able to read a set of numbers contained at the >>>> beginning >>>> of a file and store the values in variables used in a GnuPlot script. >>>> Can >>>> this be done? If yes then how? >>>> >>>> Thanks again! >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> _______________________________________________ >>>> gnuplot-info mailing list >>>> gnu...@li... >>>> https://lists.sourceforge.net/lists/listinfo/gnuplot-info >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://old.nabble.com/reading-file-data-into-variables-tp28614622p28620101.html >>> Sent from the Gnuplot - User mailing list archive at Nabble.com. >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> gnuplot-info mailing list >>> gnu...@li... >>> https://lists.sourceforge.net/lists/listinfo/gnuplot-info >>> >> >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> gnuplot-info mailing list >> gnu...@li... >> https://lists.sourceforge.net/lists/listinfo/gnuplot-info >> >> > > -- > View this message in context: > http://old.nabble.com/reading-file-data-into-variables-tp28614622p28634613.html > Sent from the Gnuplot - User mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > |