Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?J=c3=b6rg_Buchholz?= Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Heatmap doesn't show all the points Date: Wed, 11 Nov 2015 19:50:11 +0100 Organization: A noiseless patient Spider Lines: 151 Message-ID: References: <6aef38f8-f732-4764-b955-21ef638319d8@googlegroups.com> <47810301-c4a7-4e30-a85b-827b752e96ba@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Date: Wed, 11 Nov 2015 18:47:17 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="c9ce6a3646a734281e7f126eed0e299b"; logging-data="2749"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/9vSEtwO8HqbKLx86EvbiVakaUhzxijbs=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 In-Reply-To: <47810301-c4a7-4e30-a85b-827b752e96ba@googlegroups.com> Cancel-Lock: sha1:FCMUdWGq7xl9lv9dnT6Kp3KouGw= Xref: csiph.com comp.graphics.apps.gnuplot:3126 On 11.11.2015 13:25, Miguel A. Fern=E1ndez wrote: > El mi=E9rcoles, 11 de noviembre de 2015, 10:13:38 (UTC+1), J=F6rg Buchh= olz escribi=F3: >> On 11.11.2015 09:49, Miguel A. Fern=E1ndez wrote: >>> El mi=E9rcoles, 11 de noviembre de 2015, 7:15:22 (UTC+1), J=F6rg Buch= holz escribi=F3: >>>> On 10.11.2015 15:23, Miguel A. Fern=E1ndez wrote: >>>>> El martes, 10 de noviembre de 2015, 14:30:24 (UTC+1), J=F6rg Buchho= lz >>>>> escribi=F3: >>>>>> On 10.11.2015 12:52, Miguel A. Fern=E1ndez wrote: >>>>>>> El martes, 10 de noviembre de 2015, 8:43:42 (UTC+1), J=F6rg >>>>>>> Buchholz escribi=F3: >>>>>>>> On 09.11.2015 22:12, Miguel A. Fern=E1ndez wrote: >>>>>>>> >>>>>>>>> Inside the program i have something like this: >>>>>>>>> >>>>>>>>> write (*,*) 'set xr [0 to 150] write (*,*) 'set yr [0 to >>>>>>>>> 150] write (*,*) 'set zr [-150 to 150] write (*,*) 'set view >>>>>>>>> map' write (*,*) 'splot ''heatmapE.dat'' u 1:2:3 with pm3d' >>>>>>>> >>>>>>>> I think it must be a single ' or a " but not two '' around the >>>>>>>> filename. With two '' gnuplot gives empty white plots to me. >>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> The file 'heatmapE.dat' is being generated simultaneously. >>>>>>>>> Once the file is completed, I plot it, and then replace it, >>>>>>>>> because I have several frames that must be ploted one after >>>>>>>>> the other >>>>>>>>> >>>>>>>>> So, the problem is, when gnuplot plots the heatmap, some data >>>>>>>>> is missing (some pixels are white, a lot of them, indeed). I >>>>>>>>> checked the file 'heatmapE.dat' and all the data is there, >>>>>>>>> but somehow gnuplot doesnt recognise it. >>>>>>>> >>>>>>>> Does it works from inside gnuplot, or gives gnuplot some >>>>>>>> errorcodes to you? >>>>>>>> >>>>>>>> First thing I would like to try is starting gnuplot and plot a >>>>>>>> example datafile. >>>>>>>> >>>>>>>> J=F6rg >>>>>>> >>>>>>> Hello J=F6rg, and thank you for your answer. First of all, the >>>>>>> thing with the filename it's just a fortran notation, because you= >>>>>>> have to put the thing you want to output between '...'. In any >>>>>>> case, I alredy change it to "...", just in case. >>>>>>> >>>>>>> I also tried a little test: -I modified mi program, so that it >>>>>>> waits for you to press enter between a file and the next one. -I >>>>>>> opened two terminals, one with the program, and one with gnuplot,= >>>>>>> the last one with all the ranges defined. -I press enter and the >>>>>>> program creates the file, then I plot it with gnuplot and... >>>>>>> evrything looks great!. I do this several times and there are no >>>>>>> white spots. >>>>>>> >>>>>>> The thing is, I want that to be automatic, without me having to >>>>>>> press enter and plotting the data (I want something like a gif). >>>>>>> >>>>>>> I don't know exactly what could be the problem, but it seems >>>>>>> like gnuplot makes the heatmap before the program finish to put >>>>>>> all the data in the file (?) >>>>>>> >>>>>> >>>>>> Can you integrate a waiting time into your fortran code? Instead o= f >>>>>> "waiting for enter". Or something that tests if the datafile is >>>>>> complete. But then it is no gnuplot problem. >>>>>> >>>>>> Or you call gnuplot to wait befor the plotting command. "pause 10"= >>>>>> -> gnuplot waits for 10 seconds before going on. >>>>>> >>>>>> I think (IMHO) the combination of a | Pipe, writing to a file and >>>>>> reading the same file is problematic. >>>>>> >>>>>> J=F6rg >>>>> >>>>> Thank you J=F6rg, because I think you just solved my problem. Yeste= rday >>>>> I tried adding a pause in the program, but I discovered that the >>>>> function "pause" has been deleted of fortran a long time ago, so I >>>>> desisted. Today I searched a little bit more and I found the functi= on >>>>> "sleep", wich is exactly the same as pause, so I added it just afte= r >>>>> the plotting. And it works! >>>>> >>>>> Now the program is working, just a bit slow because of the pause. I= >>>>> think the problem was that, while gnuplot was plotting all the data= , >>>>> fortran was replacing the file with an empty one, creating as a >>>>> result those white spots. >>>> >>>> >>>> Hello Miguel, >>>> >>>> if you rename the file before ploting the data, you can read (gnuplo= t) >>>> and write (fortran) at the same time. >>>> >>>> write data to file-1 >>>> rename file-1 to file-2 >>>> plot file-2 >>>> rewrite data to file-1 >>>> >>>> >>>> J=F6rg >>> >>> Hello J=F6rg, even a better solution, much more eficient. >>> >>> Do you have any idea why is that? >>> >> >> CALL SYSTEM('mv file-1 file-2') >> >> or >> >> call rename("file-1", "file-2") >> >> Search for "rename + file + Fortran" on the www. I' am out of Fortran >> since more than 30 years, and never been good in this. >> >> And it is realy offtopic in this news-group. I think you will find a >> solution. >> >> J=F6rg > > I searched when I saw your message suggesting the rename solution, and = it works perfect. > > I was wondering if you knew why this is like that? Why gnuplot recognis= e the file when I rename it? > Why not? I hope you change the programcode from write (*,*) 'splot ''heatmapE.dat'' u 1:2:3 with pm3d' to write (*,*) 'splot "file-2" u 1:2:3 with pm3d' Where "file-2" is the filename that you use as the second filename. If=20 not, I wondering too that it works. J=F6rg