|
From: Patrick D. <pd...@gm...> - 2018-10-12 01:08:58
|
Hello,
When I use:
set table "0f_Lor_fitted.asc" ; plot [x_min:x_max] '+' u 1:(ampl*Lor_D(x-x0,W)+offset+y_lin(x-x0,slope)) with table ; unset table
I get a proper file.
But, when I do (to get more control on the data format)
set table "0f_Lor_fitted.asc" ; plot [x_min:x_max] '+' u (sprintf("%g,$1)):(ampl*Lor_D(x-x0,W)+offset+y_lin(x-x0,slope)) with table ; unset table
I get:
nan
instead of the expected value.
I thought that I did like it is described in the manual.
What did I miss?
Thank
===========================================================================
Patrick DUPRÉ | | email: pd...@gm...
Laboratoire de Physico-Chimie de l'Atmosphère | |
Université du Littoral-Côte d'Opale | |
Tel. (33)-(0)3 28 23 76 12 | | Fax: 03 28 65 82 44
189A, avenue Maurice Schumann | | 59140 Dunkerque, France
===========================================================================
|
|
From: Ethan A M. <eam...@gm...> - 2018-10-13 17:16:28
|
On Friday, 12 October 2018 03:08:49 Patrick Dupre wrote:
> Hello,
>
> When I use:
> set table "0f_Lor_fitted.asc" ; plot [x_min:x_max] '+' u 1:(ampl*Lor_D(x-x0,W)+offset+y_lin(x-x0,slope)) with table ; unset table
>
> I get a proper file.
> But, when I do (to get more control on the data format)
>
> set table "0f_Lor_fitted.asc" ; plot [x_min:x_max] '+' u (sprintf("%g,$1)):(ampl*Lor_D(x-x0,W)+offset+y_lin(x-x0,slope)) with table ; unset table
>
> I get:
> nan
> instead of the expected value.
>
> I thought that I did like it is described in the manual.
> What did I miss?
When I try to reproduce this problem I get an error because
there is a missing quote to terminate "%g". If I add the
quote, then it works with no error. But I had to invent
functions and constants fro ampl Lor_D W and so on.
Can you either provide the full script or reduce the problem
to a stand-alone command?
Ethan
|
|
From: Gunter K. <gu...@pe...> - 2018-10-13 17:19:42
|
Many compilers nowadays output warnings on encountering sprintf instead of an snprintf... -- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet. |
|
From: Ethan A M. <eam...@gm...> - 2018-10-13 18:16:49
|
On Saturday, 13 October 2018 19:19:29 Gunter Königsmann wrote: > Many compilers nowadays output warnings on encountering sprintf instead of an snprintf... This particular "sprintf" is a gnuplot internal function that does type checking of the gnuplot user variables and then wraps calls to a C library snprintf. Ethan |
|
From: Patrick D. <pd...@gm...> - 2018-10-14 01:39:48
|
===========================================================================
Patrick DUPRÉ | | email: pd...@gm...
Laboratoire de Physico-Chimie de l'Atmosphère | |
Université du Littoral-Côte d'Opale | |
Tel. (33)-(0)3 28 23 76 12 | | Fax: 03 28 65 82 44
189A, avenue Maurice Schumann | | 59140 Dunkerque, France
===========================================================================
> Sent: Saturday, October 13, 2018 at 7:16 PM
> From: "Ethan A Merritt" <eam...@gm...>
> To: gnu...@li...
> Cc: "Patrick Dupre" <pd...@gm...>
> Subject: Re: [Gnuplot-info] sprintf
>
> On Friday, 12 October 2018 03:08:49 Patrick Dupre wrote:
> > Hello,
> >
> > When I use:
> > set table "0f_Lor_fitted.asc" ; plot [x_min:x_max] '+' u 1:(ampl*Lor_D(x-x0,W)+offset+y_lin(x-x0,slope)) with table ; unset table
> >
> > I get a proper file.
> > But, when I do (to get more control on the data format)
> >
> > set table "0f_Lor_fitted.asc" ; plot [x_min:x_max] '+' u (sprintf("%g,$1)):(ampl*Lor_D(x-x0,W)+offset+y_lin(x-x0,slope)) with table ; unset table
> >
> > I get:
> > nan
> > instead of the expected value.
> >
> > I thought that I did like it is described in the manual.
> > What did I miss?
>
> When I try to reproduce this problem I get an error because
> there is a missing quote to terminate "%g". If I add the
> quote, then it works with no error. But I had to invent
> functions and constants fro ampl Lor_D W and so on.
> Can you either provide the full script or reduce the problem
> to a stand-alone command?
Here is an example
y_lin(x,a) = a * x
set table "tmp.asc" ; plot [-10:10] '+' u 1:(y_lin (x,2)) with table ; unset table
set table "tmp.asc" ; plot [-10:10] '+' u (sprintf("%g",$1)):(y_lin (x,2)) with table ; unset table
|
|
From: Ethan A M. <eam...@gm...> - 2018-10-14 03:01:27
|
On Sunday, 14 October 2018 03:39:38 Patrick Dupre wrote:
> y_lin(x,a) = a * x
> set table "tmp.asc" ; plot [-10:10] '+' u 1:(y_lin (x,2)) with table ; unset table
> set table "tmp.asc" ; plot [-10:10] '+' u (sprintf("%g",$1)):(y_lin (x,2)) with table ; unset table
Those both produce the same output for me when tested with
versions 5.2.0 5.2.5 (current) and development version 5.3
I do see NaN output fields when testing with version 5.0.7
So if you are running 5.0 I think the answer is that "with table" didn't
gain the ability to handle string data columns until version 5.2
If you are running 5.2 please tell us the precise gnuplot version
and operating system environment you are running.
Ethan
|
|
From: Patrick D. <pd...@gm...> - 2018-10-14 03:35:09
|
>
> On Sunday, 14 October 2018 03:39:38 Patrick Dupre wrote:
> > y_lin(x,a) = a * x
> > set table "tmp.asc" ; plot [-10:10] '+' u 1:(y_lin (x,2)) with table ; unset table
> > set table "tmp.asc" ; plot [-10:10] '+' u (sprintf("%g",$1)):(y_lin (x,2)) with table ; unset table
>
> Those both produce the same output for me when tested with
> versions 5.2.0 5.2.5 (current) and development version 5.3
>
> I do see NaN output fields when testing with version 5.0.7
>
> So if you are running 5.0 I think the answer is that "with table" didn't
> gain the ability to handle string data columns until version 5.2
> If you are running 5.2 please tell us the precise gnuplot version
> and operating system environment you are running.
>
> Ethan
>
I am running 5.0.6 from the fedora 28 distribution
It looks like than even fedora 29 comes with the version 5.0.6
|
|
From: Patrick D. <pd...@gm...> - 2018-10-14 04:01:43
|
> >
> > On Sunday, 14 October 2018 03:39:38 Patrick Dupre wrote:
> > > y_lin(x,a) = a * x
> > > set table "tmp.asc" ; plot [-10:10] '+' u 1:(y_lin (x,2)) with table ; unset table
> > > set table "tmp.asc" ; plot [-10:10] '+' u (sprintf("%g",$1)):(y_lin (x,2)) with table ; unset table
> >
> > Those both produce the same output for me when tested with
> > versions 5.2.0 5.2.5 (current) and development version 5.3
> >
> > I do see NaN output fields when testing with version 5.0.7
> >
> > So if you are running 5.0 I think the answer is that "with table" didn't
> > gain the ability to handle string data columns until version 5.2
> > If you are running 5.2 please tell us the precise gnuplot version
> > and operating system environment you are running.
> >
> > Ethan
> >
> I am running 5.0.6 from the fedora 28 distribution
> It looks like than even fedora 29 comes with the version 5.0.6
>
Actually, I had to recompile the version of the distribution to get the cwerf function.
I guess that I have to do the same with the version 5.2
> _______________________________________________
> gnuplot-info mailing list
> gnu...@li...
> Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
|
|
From: Ethan A M. <eam...@gm...> - 2018-10-14 04:15:56
|
On Sunday, 14 October 2018 05:34:59 Patrick Dupre wrote:
> >
> > On Sunday, 14 October 2018 03:39:38 Patrick Dupre wrote:
> > > y_lin(x,a) = a * x
> > > set table "tmp.asc" ; plot [-10:10] '+' u 1:(y_lin (x,2)) with table ; unset table
> > > set table "tmp.asc" ; plot [-10:10] '+' u (sprintf("%g",$1)):(y_lin (x,2)) with table ; unset table
> >
> > Those both produce the same output for me when tested with
> > versions 5.2.0 5.2.5 (current) and development version 5.3
> >
> > I do see NaN output fields when testing with version 5.0.7
> >
> > So if you are running 5.0 I think the answer is that "with table" didn't
> > gain the ability to handle string data columns until version 5.2
> > If you are running 5.2 please tell us the precise gnuplot version
> > and operating system environment you are running.
> >
> > Ethan
> >
> I am running 5.0.6 from the fedora 28 distribution
> It looks like than even fedora 29 comes with the version 5.0.6
Huh. I had the impression that Fedora was known for "bleeding edge"
software versions.
Since gnuplot 5.2 came out more than a year ago I would have thought
it would have been picked up by now. FWIW Ubuntu and Mageia are both
on 5.2.2 for their "upcoming release" spins, and OpenSUSE is fully current
at 5.2.5. Maybe it would be worth poking the Fedora packaging team?
Ethan
|
|
From: Patrick D. <pd...@gm...> - 2018-10-14 06:14:57
|
>
> On Sunday, 14 October 2018 05:34:59 Patrick Dupre wrote:
> > >
> > > On Sunday, 14 October 2018 03:39:38 Patrick Dupre wrote:
> > > > y_lin(x,a) = a * x
> > > > set table "tmp.asc" ; plot [-10:10] '+' u 1:(y_lin (x,2)) with table ; unset table
> > > > set table "tmp.asc" ; plot [-10:10] '+' u (sprintf("%g",$1)):(y_lin (x,2)) with table ; unset table
> > >
> > > Those both produce the same output for me when tested with
> > > versions 5.2.0 5.2.5 (current) and development version 5.3
> > >
> > > I do see NaN output fields when testing with version 5.0.7
> > >
> > > So if you are running 5.0 I think the answer is that "with table" didn't
> > > gain the ability to handle string data columns until version 5.2
> > > If you are running 5.2 please tell us the precise gnuplot version
> > > and operating system environment you are running.
> > >
> > > Ethan
> > >
> > I am running 5.0.6 from the fedora 28 distribution
> > It looks like than even fedora 29 comes with the version 5.0.6
>
> Huh. I had the impression that Fedora was known for "bleeding edge"
> software versions.
>
> Since gnuplot 5.2 came out more than a year ago I would have thought
> it would have been picked up by now. FWIW Ubuntu and Mageia are both
> on 5.2.2 for their "upcoming release" spins, and OpenSUSE is fully current
> at 5.2.5. Maybe it would be worth poking the Fedora packaging team?
>
> Ethan
https://bugzilla.redhat.com/show_bug.cgi?id=1457252
https://bugzilla.redhat.com/show_bug.cgi?id=1476616
|