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


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

Format change converter to 5.0?

Started byOlaf Schultz <o.schultz@enhydralutris.de>
First post2017-03-30 20:44 +0200
Last post2017-04-01 15:32 -0700
Articles 7 — 3 participants

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


Contents

  Format change converter to 5.0? Olaf Schultz <o.schultz@enhydralutris.de> - 2017-03-30 20:44 +0200
    Re: Format change converter to 5.0? Karl Ratzsch <mail.kfr@gmx.net> - 2017-03-31 05:14 +0200
      Re: Format change converter to 5.0? Olaf Schultz <o.schultz@enhydralutris.de> - 2017-04-01 12:06 +0200
        Re: Format change converter to 5.0? Karl Ratzsch <mail.kfr@gmx.net> - 2017-04-01 23:17 +0200
          Re: Format change converter to 5.0? Ethan A Merritt <EAMerritt@gmail.com> - 2017-04-01 15:16 -0700
            Re: Format change converter to 5.0? Olaf Schultz <o.schultz@enhydralutris.de> - 2017-04-02 09:48 +0200
          Re: Format change converter to 5.0? Ethan A Merritt <EAMerritt@gmail.com> - 2017-04-01 15:32 -0700

#3601 — Format change converter to 5.0?

FromOlaf Schultz <o.schultz@enhydralutris.de>
Date2017-03-30 20:44 +0200
SubjectFormat change converter to 5.0?
Message-ID<ek51vjFffU1@mid.individual.net>
Moin,

I have several files from older versions (4.4, 4.6...) which must now
run also under 5.0... and that (censored) version complains not only
ones about strange format and does nothing (better than just plot and
strange results on the screen)...
Actual:

set timefmt x "%Y-%m"

Is there a script/tool existing which is able to convert the format of
gnuplot-files to the new version?

Greetings,
Olaf

[toc] | [next] | [standalone]


#3602

FromKarl Ratzsch <mail.kfr@gmx.net>
Date2017-03-31 05:14 +0200
Message-ID<obkhje$nu8$1@solani.org>
In reply to#3601
Am 30.03.2017 um 20:44 schrieb Olaf Schultz:
> I have several files from older versions (4.4, 4.6...) which must now
> run also under 5.0... and that (censored) version complains not only
> ones about strange format and does nothing (better than just plot and
> strange results on the screen)...
> Actual:
> 
> set timefmt x "%Y-%m"
> 
> Is there a script/tool existing which is able to convert the format of
> gnuplot-files to the new version?

("censored"?)

Not to my knowledge. Who would want to spend more time on developing
such a tool than on converting a few old scripts?

But you can just go and strip the axis specifiers from all "set timefmt"
commands in your scripts, and see what happens. I'll doubt you see any
difference. According to the docs, even version 4.4 never expected any
axis specifier there (it was accepted, though, up to 4.6.6).

("set timefmt" is for _reading in_ time data, not for formatting the
output, that was always done by "set format". You don't have different
time formats in one data file, do you?)

  Karl

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


#3603

FromOlaf Schultz <o.schultz@enhydralutris.de>
Date2017-04-01 12:06 +0200
Message-ID<ek9cduFphepU1@mid.individual.net>
In reply to#3602
On 03/31/17 05:14, Karl Ratzsch wrote:
> Am 30.03.2017 um 20:44 schrieb Olaf Schultz:
>> I have several files from older versions (4.4, 4.6...) which must now
>> run also under 5.0... and that (censored) version complains not only
>> ones about strange format and does nothing (better than just plot and
>> strange results on the screen)...
>> Actual:
>>
>> set timefmt x "%Y-%m"
>>
>> Is there a script/tool existing which is able to convert the format of
>> gnuplot-files to the new version?
> 
> ("censored"?)
> 
> Not to my knowledge. Who would want to spend more time on developing
> such a tool than on converting a few old scripts?
> 
> But you can just go and strip the axis specifiers from all "set timefmt"
> commands in your scripts, and see what happens. I'll doubt you see any
> difference. According to the docs, even version 4.4 never expected any
> axis specifier there (it was accepted, though, up to 4.6.6).


That's what I have here in a file... (save "...gnu" So gnuplot had wrote
this syntax in the past:

#!/usr/local/bin/gnuplot -persist
#
#
#       G N U P L O T
#       Version 4.4 patchlevel 3
#       last modified March 2011
#       System: Linux 2.6.27.48-0.3-pae
#
#       Copyright (C) 1986-1993, 1998, 2004, 2007-2010
#       Thomas Williams, Colin Kelley and many others
#
#       gnuplot home:     http://www.gnuplot.info
#       faq, bugs, etc:   type "help seeking-assistance"
#       immediate help:   type "help"
#       plot window:      hit 'h'
# set terminal wxt 0
# set output
unset clip points
set clip one
unset clip two
set bar 1.000000 front
set border 31 front linetype -1 linewidth 1.000
set xdata time
set ydata
set zdata
set x2data
set y2data
set timefmt x "%Y-%m"
set timefmt y "%d/%m/%y,%H:%M"
set timefmt z "%d/%m/%y,%H:%M"
set timefmt x2 "%d/%m/%y,%H:%M"
set timefmt y2 "%d/%m/%y,%H:%M"
....


My ~/.gnuplot is rather short and does not consists that.

O.K. Here it worked for this file just open gnuplet, set timefmt without
that x and copy-paste the plot-line...

But I have also a lot of other files coming from 4.3.... where not only
this lines needs to be converted because just two \042 have to be
removed in several lines.

And if I go and write an awk-script for that... Should have started in
the past with just saving empty plit-files to find the diff with old/new
version and what to be removed/changed. Maybe I will do this...

Just to state: I like gnuplot, use it frequently since approx. 20 years,
at home and in the job... but this tiny but nerving format changes. Seem
that I have to do it as on the job (there 4.6.1 is the most actual
version;-)... install several versions also at home:-(

Olaf

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


#3604

FromKarl Ratzsch <mail.kfr@gmx.net>
Date2017-04-01 23:17 +0200
Message-ID<obp5ch$tnn$1@solani.org>
In reply to#3603
Am 01.04.2017 um 12:06 schrieb Olaf Schultz:

> But I have also a lot of other files coming from 4.3.... where not only
> this lines needs to be converted because just two \042 have to be
> removed in several lines.
> 
> And if I go and write an awk-script for that... Should have started in
> the past with just saving empty plit-files to find the diff with old/new
> version and what to be removed/changed. Maybe I will do this...
> 
> Just to state: I like gnuplot, use it frequently since approx. 20 years,
> at home and in the job... but this tiny but nerving format changes. Seem
> that I have to do it as on the job (there 4.6.1 is the most actual
> version;-)... install several versions also at home:-(
> 
> Olaf

Well, it's sometimes a toss-up between adding new features with a
sensible syntax, and keeping things backwards compatible. And I must
say that the developers are trying very hard to do both

(Although I say the "set timefmt x" thing was more a bug, an
undocumented feature should never have made it into the default
saved plot files, imho.)

Best thing i can recommend is to not build plots online on the
gnuplot console and then save them to .plt file, but write the
script by yourself, and always load it from the script file. That
way you are sure they contain just everything you need, and it's
much easier to later re-work the plot, be it because of a syntax
change or because you want something changed in the plot.

A "save" option that omits all default settings would be nice, but
also probably a nightmare to write and debug. Some commands have
just too many options.

  Karl

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


#3605

FromEthan A Merritt <EAMerritt@gmail.com>
Date2017-04-01 15:16 -0700
Message-ID<obp8n3$422$1@dont-email.me>
In reply to#3604
Karl Ratzsch wrote:

> Am 01.04.2017 um 12:06 schrieb Olaf Schultz:
> 
>> But I have also a lot of other files coming from 4.3.... where not
>> only this lines needs to be converted because just two \042 have to
>> be removed in several lines.
>> 
>> And if I go and write an awk-script for that... Should have started
>> in the past with just saving empty plit-files to find the diff with
>> old/new version and what to be removed/changed. Maybe I will do
>> this...
>> 
>> Just to state: I like gnuplot, use it frequently since approx. 20
>> years, at home and in the job... but this tiny but nerving format
>> changes. Seem that I have to do it as on the job (there 4.6.1 is the
>> most actual version;-)... install several versions also at home:-(
>> 
>> Olaf
> 
> Well, it's sometimes a toss-up between adding new features with a
> sensible syntax, and keeping things backwards compatible. And I must
> say that the developers are trying very hard to do both
> 
> (Although I say the "set timefmt x" thing was more a bug, an
> undocumented feature should never have made it into the default
> saved plot files, imho.)
> 
> Best thing i can recommend is to not build plots online on the
> gnuplot console and then save them to .plt file, but write the
> script by yourself, and always load it from the script file. That
> way you are sure they contain just everything you need, and it's
> much easier to later re-work the plot, be it because of a syntax
> change or because you want something changed in the plot.
> 
> A "save" option that omits all default settings would be nice, but
> also probably a nightmare to write and debug. Some commands have
> just too many options. 
>   Karl

There is a separate utility script "gpsavediff" that strips out all
the default options from a saved script.  However it assumes that the
current version of gnuplot that it runs matches the version that 
created the script.  So it's useful at the time you save something,
but not so much as a tool to clean up scripts saved a long time ago.

I.e., the usual use is like this:

   gnuplot>  ... plot some stuff ...
   gnuplot>  save "|gpsavediff > myplot.gp"

or like this:

   $ gpsavediff < fulldump.gp > cleanup_up.gp


You can download a copy of the gpsavediff script here:

   http://gnuplot.sourceforge.net/scripts/files/gpsavediff


      - Ethan

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


#3607

FromOlaf Schultz <o.schultz@enhydralutris.de>
Date2017-04-02 09:48 +0200
Message-ID<ekbolnF983uU1@mid.individual.net>
In reply to#3605
On 04/02/17 00:16, Ethan A Merritt wrote:
> Karl Ratzsch wrote:
> 
>> Am 01.04.2017 um 12:06 schrieb Olaf Schultz:
>>
>>> But I have also a lot of other files coming from 4.3.... where not
>>> only this lines needs to be converted because just two \042 have to
>>> be removed in several lines.
>>>
>>> And if I go and write an awk-script for that... Should have started
>>> in the past with just saving empty plit-files to find the diff with
>>> old/new version and what to be removed/changed. Maybe I will do
>>> this...
>>>
>>> Just to state: I like gnuplot, use it frequently since approx. 20
>>> years, at home and in the job... but this tiny but nerving format
>>> changes. Seem that I have to do it as on the job (there 4.6.1 is the
>>> most actual version;-)... install several versions also at home:-(
>>>
>>> Olaf
>>
>> Well, it's sometimes a toss-up between adding new features with a
>> sensible syntax, and keeping things backwards compatible. And I must
>> say that the developers are trying very hard to do both
>>
>> (Although I say the "set timefmt x" thing was more a bug, an
>> undocumented feature should never have made it into the default
>> saved plot files, imho.)
>>
>> Best thing i can recommend is to not build plots online on the
>> gnuplot console and then save them to .plt file, but write the
>> script by yourself, and always load it from the script file. That
>> way you are sure they contain just everything you need, and it's
>> much easier to later re-work the plot, be it because of a syntax
>> change or because you want something changed in the plot.
>>
>> A "save" option that omits all default settings would be nice, but
>> also probably a nightmare to write and debug. Some commands have
>> just too many options. 
>>   Karl
> 
> There is a separate utility script "gpsavediff" that strips out all
> the default options from a saved script.  However it assumes that the
> current version of gnuplot that it runs matches the version that 
> created the script.  So it's useful at the time you save something,
> but not so much as a tool to clean up scripts saved a long time ago.
> 
> I.e., the usual use is like this:
> 
>    gnuplot>  ... plot some stuff ...
>    gnuplot>  save "|gpsavediff > myplot.gp"
> 
> or like this:
> 
>    $ gpsavediff < fulldump.gp > cleanup_up.gp
> 
> 
> You can download a copy of the gpsavediff script here:
> 
>    http://gnuplot.sourceforge.net/scripts/files/gpsavediff
> 
> 
>       - Ethan
> 

Thanks, that should solve that.

About the other answer... that's live...
If I have a look in the .gnu-files... they are long... and I don't carry
much about the top... (seem to be not the only one;-)

Just modifying the last lines in an $Editor. Especially if I have to
create 20 multiplots with 3 windows for and approx 20 curves per page (6
per plot) in total to be displayed. Use it in an editor, output
ps>pdf>pdfcrop (our sysads don't provide pdf native...)*
Don't know how to get such a good overview and pictures traceable back
for the next 30+ years in XLS:-)

Olaf

*I'am a lucky guy to convince them to install 4.6 WITH readline (not
default version).

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


#3606

FromEthan A Merritt <EAMerritt@gmail.com>
Date2017-04-01 15:32 -0700
Message-ID<obp9jf$6bt$1@dont-email.me>
In reply to#3604
Karl Ratzsch wrote:

> Am 01.04.2017 um 12:06 schrieb Olaf Schultz:
> 
>> But I have also a lot of other files coming from 4.3.... where not
>> only this lines needs to be converted because just two \042 have to
>> be removed in several lines.
>> 
>> And if I go and write an awk-script for that... Should have started
>> in the past with just saving empty plit-files to find the diff with
>> old/new version and what to be removed/changed. Maybe I will do
>> this...
>> 
>> Just to state: I like gnuplot, use it frequently since approx. 20
>> years, at home and in the job... but this tiny but nerving format
>> changes. Seem that I have to do it as on the job (there 4.6.1 is the
>> most actual version;-)... install several versions also at home:-(
>> 
>> Olaf
> 
> Well, it's sometimes a toss-up between adding new features with a
> sensible syntax, and keeping things backwards compatible. And I must
> say that the developers are trying very hard to do both
> 
> (Although I say the "set timefmt x" thing was more a bug, an
> undocumented feature should never have made it into the default
> saved plot files, imho.)


I've just gone back to look at the documentation for earlier versions.
The form of the "set timefmt" command emitted by "save" was incorrect all
the way back to version 4.0.   Version 4 was accepting it on input for
backwards compatibility with version 3, but there was no good reason to
emit it in output from "save".  It is a pity no one reported this bug at
the time - we could have fixed it 12 years ago.

   Ethan

[toc] | [prev] | [standalone]


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


csiph-web