#50 neat way to handle filenames

closed
None
5
2005-11-02
2005-11-02
Anonymous
No

Hello,

Thank's a lot for gnuplot, I used it in my diploma
thesis, and continue to use it now at work.

I use it a lot to work on tabulated data (fitting,
plotting), but what I miss is a neat way to use a
single pnuplot-script for several data files. My
workaround is to use grep (or the replace function in
the texteditor) to substitute a placeholder-string
before runnuing gnuplot, but what I would really
appreciate would be some kind of variable for strings,
maybe even with the possibility to manipulate and to
pass as a parameter from the commandline.

maybe
>gnuplot dayplot.plt 01112005

#dayplot.plt
set label $1
filename="data-"+$1+".csv"
fit f(x) filename via a,b
plot f(x), filename

Greetings, Frederik

Discussion

  • Hans-Bernhard Broeker

    Logged In: YES
    user_id=27517

    There are several approaches to this besides filtering plot
    scripts
    through 'sed' (grep wouldn't be very useful...):

    1) the 'call' command in gnuplot
    2) back-tick substitution in gnuplot
    3) "HERE scripts" for the shell instead of gnuplot scripts
    4) fully dynamic remote control of gnuplot through a pipe from
    a Perl/Python/Java/C/whatever program

    And, as of the current development version, there are now
    also string manipulation operators inside gnuplot.

     
  • Hans-Bernhard Broeker

    • assigned_to: nobody --> broeker
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks