|
From: Yonghui <lyh...@gm...> - 2013-05-17 05:24:05
|
Thanks Ethan, I am actually making a movie. 200 pictures, each picture is the 100x100 matrix. Here is the command: -----------plot_TDM.gp-------------- set term gif size 640,640 animate delay 10 set out '@movie_TDM.gif' unset key set cbrange[-0.01:0.01] i=0 set pm3d unset surface set view map set palette defined (-0.01 "red", 0 "white", 0.01 "blue") load "plot_TDM_loop.gp" unset out quit ------------plot_TDM_loop.gp"---------------- splot '_TDTDM.dat' matrix ind i*10 print i i=i+1 if (i<200) reread Please take a look. Thanks. Yonghui -----Original Message----- From: Ethan A Merritt [mailto:eam...@gm...] Sent: Friday, May 17, 2013 12:18 AM To: gnu...@li... Cc: FortCpp Subject: Re: [Gnuplot-info] Plot matrix with GNUplot. Slow On Thursday, 16 May 2013, FortCpp wrote: > I am using GNUplot for plotting a small matrix. The matrix is 100x100 > by size. e.g. > > 1.23212 2.43123 -1.24312 ...... > -4.23123 2.00458 5.60234 ...... > ...... > The data is not neatly stored in the file. So from C++ point of view, > due to the lack of length per data, there is no way to load a whole > number, but it has to check when the number is loading. I guess this > should be the reason of the slow plotting speed. > > Now I have 3 questions: > Q1: Is loading the bottle neck? > > Q2: If I can make the data file neatly stored (setw). e.g. > > 1.23212 2.43123 -1.24312 ...... > -4.23123 2.00458 5.60234 ...... > ...... > Does the plotting speed get any improvement? (Maybe GNUplot can check > what the pattern is. Thus improve the loading speed. Not sure.) No. That won't make any difference. > > Q3: Any other options that I can set to make it faster? gnuplot> help fpe The `set datafile nofpe_trap` command tells gnuplot not to re-initialize a floating point exception handler before every expression evaluation used while reading data from an input file. This can significantly speed data input from very large files at the risk of program termination if a floating-point exception is generated. You haven't shown us the commands you use to read the file, so I don't know if this is relevant to your case. There is a recent patch in the CVS version that hugely speeds up reading binary matrices, but since the matrix you show is in ascii that wouldn't help. Ethan -- Tradition is not the worship of ashes, but the preservation of fire. - Gustav Mahler |