Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #3113 > unrolled thread

Heatmap doesn't show all the points

Started byMiguel A. Fernández <mafergon94@gmail.com>
First post2015-11-09 13:12 -0800
Last post2015-11-11 19:50 +0100
Articles 14 — 4 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  Heatmap doesn't show all the points Miguel A. Fernández <mafergon94@gmail.com> - 2015-11-09 13:12 -0800
    Re: Heatmap doesn't show all the points Jörg Buchholz <bookwood4new@freenet.de> - 2015-11-10 08:43 +0100
      Re: Heatmap doesn't show all the points Miguel A. Fernández <mafergon94@gmail.com> - 2015-11-10 03:52 -0800
        Re: Heatmap doesn't show all the points Jörg Buchholz <bookwood4new@freenet.de> - 2015-11-10 14:30 +0100
          Re: Heatmap doesn't show all the points Miguel A. Fernández <mafergon94@gmail.com> - 2015-11-10 06:23 -0800
            Re: Heatmap doesn't show all the points Karl Ratzsch <mail.kfr@gmx.net> - 2015-11-10 16:52 +0100
              Re: Heatmap doesn't show all the points Miguel A. Fernández <mafergon94@gmail.com> - 2015-11-10 11:36 -0800
                Re: Heatmap doesn't show all the points Karl Ratzsch <mail.kfr@gmx.net> - 2015-11-11 10:36 +0100
                  Re: Heatmap doesn't show all the points Miguel A. Fernández <mafergon94@gmail.com> - 2015-11-11 04:22 -0800
            Re: Heatmap doesn't show all the points Jörg Buchholz <bookwood4new@freenet.de> - 2015-11-11 07:15 +0100
              Re: Heatmap doesn't show all the points Miguel A. Fernández <mafergon94@gmail.com> - 2015-11-11 00:49 -0800
                Re: Heatmap doesn't show all the points Jörg Buchholz <bookwood4new@freenet.de> - 2015-11-11 10:13 +0100
                  Re: Heatmap doesn't show all the points Miguel A. Fernández <mafergon94@gmail.com> - 2015-11-11 04:25 -0800
                    Re: Heatmap doesn't show all the points Jörg Buchholz <bookwood4news@freenet.de> - 2015-11-11 19:50 +0100

#3113 — Heatmap doesn't show all the points

FromMiguel A. Fernández <mafergon94@gmail.com>
Date2015-11-09 13:12 -0800
SubjectHeatmap doesn't show all the points
Message-ID<fd56f163-5ad7-4f40-8d45-ab286235943e@googlegroups.com>
Hello everyone. First of all, I have to say I'm new in this kind of forums stuff, so excuse me if something is wrong.

I would like to plot a heatmap with some data (that is being generated with something I programmed in fortran). The data is in a file that looks like:

0 0 -95.----
0 1 52.----
0 2 84.----


And so on (lines represent more numbers). Im using the fortran code itself to write in the gnuplot terminal, that is to say, I call the program from the linux terminal like this:

---> electrodin.exe | gnuplot

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'


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. 

I hope I explained everything clearly.

Thank you beforehand for your help.

[toc] | [next] | [standalone]


#3114

FromJörg Buchholz <bookwood4new@freenet.de>
Date2015-11-10 08:43 +0100
Message-ID<n1s77d$716$1@newsserver.rrzn.uni-hannover.de>
In reply to#3113
On 09.11.2015 22:12, Miguel A. Fernández 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örg

[toc] | [prev] | [next] | [standalone]


#3115

FromMiguel A. Fernández <mafergon94@gmail.com>
Date2015-11-10 03:52 -0800
Message-ID<6aef38f8-f732-4764-b955-21ef638319d8@googlegroups.com>
In reply to#3114
El martes, 10 de noviembre de 2015, 8:43:42 (UTC+1), Jörg Buchholz  escribió:
> On 09.11.2015 22:12, Miguel A. Fernández 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örg

Hello Jörg, 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 (?)




[toc] | [prev] | [next] | [standalone]


#3116

FromJörg Buchholz <bookwood4new@freenet.de>
Date2015-11-10 14:30 +0100
Message-ID<n1srhe$d4o$1@newsserver.rrzn.uni-hannover.de>
In reply to#3115
On 10.11.2015 12:52, Miguel A. Fernández wrote:
> El martes, 10 de noviembre de 2015, 8:43:42 (UTC+1), Jörg Buchholz
> escribió:
>> On 09.11.2015 22:12, Miguel A. Fernández 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örg
>
> Hello Jörg, 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
of "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örg

[toc] | [prev] | [next] | [standalone]


#3117

FromMiguel A. Fernández <mafergon94@gmail.com>
Date2015-11-10 06:23 -0800
Message-ID<c52eb54e-043e-4008-b951-057c92a50fd6@googlegroups.com>
In reply to#3116
El martes, 10 de noviembre de 2015, 14:30:24 (UTC+1), Jörg Buchholz  escribió:
> On 10.11.2015 12:52, Miguel A. Fernández wrote:
> > El martes, 10 de noviembre de 2015, 8:43:42 (UTC+1), Jörg Buchholz
> > escribió:
> >> On 09.11.2015 22:12, Miguel A. Fernández 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örg
> >
> > Hello Jörg, 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
> of "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örg

Thank you Jörg, because I think you just solved my problem. Yesterday 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 function "sleep", wich is exactly the same as pause, so I added it just after 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.

Thank you again.

Miguel

[toc] | [prev] | [next] | [standalone]


#3118

FromKarl Ratzsch <mail.kfr@gmx.net>
Date2015-11-10 16:52 +0100
Message-ID<n1t3sn$dv7$1@solani.org>
In reply to#3117
Am 10.11.2015 um 15:23 schrieb Miguel A. Fernández:

> Thank you Jörg, because I think you just solved my problem. Yesterday 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 function "sleep", wich is exactly the same as pause, so I added it just after 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.
> 
> Thank you again.
> 
> Miguel
> 

Can't you just pipe commands and data into gnuplot?

[toc] | [prev] | [next] | [standalone]


#3119

FromMiguel A. Fernández <mafergon94@gmail.com>
Date2015-11-10 11:36 -0800
Message-ID<69e5b933-e34e-41ba-8630-01b892bf3679@googlegroups.com>
In reply to#3118
El martes, 10 de noviembre de 2015, 16:52:57 (UTC+1), Karl Ratzsch  escribió:
> Am 10.11.2015 um 15:23 schrieb Miguel A. Fernández:
> 
> > Thank you Jörg, because I think you just solved my problem. Yesterday 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 function "sleep", wich is exactly the same as pause, so I added it just after 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.
> > 
> > Thank you again.
> > 
> > Miguel
> > 
> 
> Can't you just pipe commands and data into gnuplot?

Hello Karl. The issue here is that the data I have to input is being created simultaneously, so I cant pipe it directly.

[toc] | [prev] | [next] | [standalone]


#3123

FromKarl Ratzsch <mail.kfr@gmx.net>
Date2015-11-11 10:36 +0100
Message-ID<n1v26t$ddr$1@solani.org>
In reply to#3119
Am 10.11.2015 um 20:36 schrieb Miguel A. Fernández:
> El martes, 10 de noviembre de 2015, 16:52:57 (UTC+1), Karl Ratzsch  escribió:

>> Can't you just pipe commands and data into gnuplot?
> 
> Hello Karl. The issue here is that the data I have to input is being created simultaneously, so I cant pipe it directly.
> 

So i understood. You could simply set up the plot as you do now _before_
all your processing, replacing the file name by "-", and then write the
data to STDOUT instead of the temporary file. Lastly write "e", and
gnuplot does the plot with exactly the data you want to have.



[toc] | [prev] | [next] | [standalone]


#3124

FromMiguel A. Fernández <mafergon94@gmail.com>
Date2015-11-11 04:22 -0800
Message-ID<febd0abe-2791-4a52-84ad-f1272ef854a9@googlegroups.com>
In reply to#3123
El miércoles, 11 de noviembre de 2015, 10:36:30 (UTC+1), Karl Ratzsch  escribió:
> Am 10.11.2015 um 20:36 schrieb Miguel A. Fernández:
> > El martes, 10 de noviembre de 2015, 16:52:57 (UTC+1), Karl Ratzsch  escribió:
> 
> >> Can't you just pipe commands and data into gnuplot?
> > 
> > Hello Karl. The issue here is that the data I have to input is being created simultaneously, so I cant pipe it directly.
> > 
> 
> So i understood. You could simply set up the plot as you do now _before_
> all your processing, replacing the file name by "-", and then write the
> data to STDOUT instead of the temporary file. Lastly write "e", and
> gnuplot does the plot with exactly the data you want to have.

I was searching for this kind of aproach on the internet, but I couldn't understand exactly how could gnuplot accept direct input of data trough a pipeline. 
Now I understand with your explanation. Thank you very much Karl, although I think I will stick to Jörg solution, just because I have it programmed alredy.

Thank you again.

[toc] | [prev] | [next] | [standalone]


#3120

FromJörg Buchholz <bookwood4new@freenet.de>
Date2015-11-11 07:15 +0100
Message-ID<n1umdo$uso$1@newsserver.rrzn.uni-hannover.de>
In reply to#3117
On 10.11.2015 15:23, Miguel A. Fernández wrote:
> El martes, 10 de noviembre de 2015, 14:30:24 (UTC+1), Jörg Buchholz
> escribió:
>> On 10.11.2015 12:52, Miguel A. Fernández wrote:
>>> El martes, 10 de noviembre de 2015, 8:43:42 (UTC+1), Jörg
>>> Buchholz escribió:
>>>> On 09.11.2015 22:12, Miguel A. Fernández 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örg
>>>
>>> Hello Jörg, 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 of
>> "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örg
>
> Thank you Jörg, because I think you just solved my problem. Yesterday
> 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 function
> "sleep", wich is exactly the same as pause, so I added it just after
> 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 (gnuplot) 
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örg

[toc] | [prev] | [next] | [standalone]


#3121

FromMiguel A. Fernández <mafergon94@gmail.com>
Date2015-11-11 00:49 -0800
Message-ID<d340b234-ed6e-4f75-826d-85150f9c973e@googlegroups.com>
In reply to#3120
El miércoles, 11 de noviembre de 2015, 7:15:22 (UTC+1), Jörg Buchholz  escribió:
> On 10.11.2015 15:23, Miguel A. Fernández wrote:
> > El martes, 10 de noviembre de 2015, 14:30:24 (UTC+1), Jörg Buchholz
> > escribió:
> >> On 10.11.2015 12:52, Miguel A. Fernández wrote:
> >>> El martes, 10 de noviembre de 2015, 8:43:42 (UTC+1), Jörg
> >>> Buchholz escribió:
> >>>> On 09.11.2015 22:12, Miguel A. Fernández 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örg
> >>>
> >>> Hello Jörg, 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 of
> >> "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örg
> >
> > Thank you Jörg, because I think you just solved my problem. Yesterday
> > 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 function
> > "sleep", wich is exactly the same as pause, so I added it just after
> > 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 (gnuplot) 
> 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örg

Hello Jörg, even a better solution, much more eficient.

Do you have any idea why is that?

[toc] | [prev] | [next] | [standalone]


#3122

FromJörg Buchholz <bookwood4new@freenet.de>
Date2015-11-11 10:13 +0100
Message-ID<n1v0s0$2ap$1@newsserver.rrzn.uni-hannover.de>
In reply to#3121
On 11.11.2015 09:49, Miguel A. Fernández wrote:
> El miércoles, 11 de noviembre de 2015, 7:15:22 (UTC+1), Jörg Buchholz  escribió:
>> On 10.11.2015 15:23, Miguel A. Fernández wrote:
>>> El martes, 10 de noviembre de 2015, 14:30:24 (UTC+1), Jörg Buchholz
>>> escribió:
>>>> On 10.11.2015 12:52, Miguel A. Fernández wrote:
>>>>> El martes, 10 de noviembre de 2015, 8:43:42 (UTC+1), Jörg
>>>>> Buchholz escribió:
>>>>>> On 09.11.2015 22:12, Miguel A. Fernández 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örg
>>>>>
>>>>> Hello Jörg, 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 of
>>>> "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örg
>>>
>>> Thank you Jörg, because I think you just solved my problem. Yesterday
>>> 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 function
>>> "sleep", wich is exactly the same as pause, so I added it just after
>>> 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 (gnuplot)
>> 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örg
>
> Hello Jörg, 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örg

[toc] | [prev] | [next] | [standalone]


#3125

FromMiguel A. Fernández <mafergon94@gmail.com>
Date2015-11-11 04:25 -0800
Message-ID<47810301-c4a7-4e30-a85b-827b752e96ba@googlegroups.com>
In reply to#3122
El miércoles, 11 de noviembre de 2015, 10:13:38 (UTC+1), Jörg Buchholz  escribió:
> On 11.11.2015 09:49, Miguel A. Fernández wrote:
> > El miércoles, 11 de noviembre de 2015, 7:15:22 (UTC+1), Jörg Buchholz  escribió:
> >> On 10.11.2015 15:23, Miguel A. Fernández wrote:
> >>> El martes, 10 de noviembre de 2015, 14:30:24 (UTC+1), Jörg Buchholz
> >>> escribió:
> >>>> On 10.11.2015 12:52, Miguel A. Fernández wrote:
> >>>>> El martes, 10 de noviembre de 2015, 8:43:42 (UTC+1), Jörg
> >>>>> Buchholz escribió:
> >>>>>> On 09.11.2015 22:12, Miguel A. Fernández 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örg
> >>>>>
> >>>>> Hello Jörg, 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 of
> >>>> "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örg
> >>>
> >>> Thank you Jörg, because I think you just solved my problem. Yesterday
> >>> 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 function
> >>> "sleep", wich is exactly the same as pause, so I added it just after
> >>> 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 (gnuplot)
> >> 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örg
> >
> > Hello Jörg, 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örg

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 recognise the file when I rename it?

[toc] | [prev] | [next] | [standalone]


#3126

FromJörg Buchholz <bookwood4news@freenet.de>
Date2015-11-11 19:50 +0100
Message-ID<n202fl$2lt$1@dont-email.me>
In reply to#3125
On 11.11.2015 13:25, Miguel A. Fernández wrote:
> El miércoles, 11 de noviembre de 2015, 10:13:38 (UTC+1), Jörg Buchholz  escribió:
>> On 11.11.2015 09:49, Miguel A. Fernández wrote:
>>> El miércoles, 11 de noviembre de 2015, 7:15:22 (UTC+1), Jörg Buchholz  escribió:
>>>> On 10.11.2015 15:23, Miguel A. Fernández wrote:
>>>>> El martes, 10 de noviembre de 2015, 14:30:24 (UTC+1), Jörg Buchholz
>>>>> escribió:
>>>>>> On 10.11.2015 12:52, Miguel A. Fernández wrote:
>>>>>>> El martes, 10 de noviembre de 2015, 8:43:42 (UTC+1), Jörg
>>>>>>> Buchholz escribió:
>>>>>>>> On 09.11.2015 22:12, Miguel A. Fernández 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örg
>>>>>>>
>>>>>>> Hello Jörg, 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 of
>>>>>> "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örg
>>>>>
>>>>> Thank you Jörg, because I think you just solved my problem. Yesterday
>>>>> 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 function
>>>>> "sleep", wich is exactly the same as pause, so I added it just after
>>>>> 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 (gnuplot)
>>>> 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örg
>>>
>>> Hello Jörg, 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örg
>
> 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 recognise 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 
not, I wondering too that it works.

Jörg

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web