Question

Don't know if it's a question for stackoverflow or superuser, but the beta SU community is still too small for such specific questions, I guess. Feel free to redirect it if you see it fit.

I am trying to setup gnuplot so that at startup I always have the comma as datafile separator, with the following command

set datafile separator ","

unfortunately, it looks like there's no concept of a ".gnuplotrc" in gnuplot (at least, I didn't find anything in the man page, and I don't have strace on this machine, so I cannot see by myself). I am tired of typing the command every time I fire up gnuplot. Does anybody have a good solution for this ?

NB: load does not solve, I would still have to type the load command.

Was it helpful?

Solution

In fact, there is a gnuplot startup file: it's called .gnuplot, and should do exactly what you want. For details, try running help startup within an interactive gnuplot session.

18 Start-up

When gnuplot is run, it looks for an initialization file to load. This file is called .gnuplot on Unix and AmigaOS systems, and GNUPLOT.INI on other systems. If this file is not found in the current directory, the program will look for it in the HOME directory (under AmigaOS, Atari(single)TOS, MS-DOS, Windows and OS/2, the environment variable GNUPLOT should contain the name of this directory; on Windows NT, it will use USERPROFILE if GNUPLOT isn’t defined). Note: if NOCWDRC is defined during the installation, gnuplot will not read from the current directory.

If the initialization file is found, gnuplot executes the commands in it. These may be any legal gnuplot commands, but typically they are limited to setting the terminal and defining frequently-used functions or variables.

http://www.gnuplot.info/docs_4.2/gnuplot.html#x1-6900018

OTHER TIPS

For the new version of gnuplot try this:

See the path of the gnuplotrc file using the command within gnuplot:

*show loadpath*

Then just open the file and add the commands you want.


Here is more info from the the documentation of the latest version(4.6):

When gnuplot is run, it first looks for a system-wide initialization file named gnuplotrc. The location of this file is determined when the program is built and is reported by show loadpath. The program then looks in the user’s HOME directory for a file called .gnuplot on Unix-like systems or GNUPLOT.INI on other systems. (Windows and OS/2 will look for it in the directory named in the environment variable GNUPLOT; Windows will use USERPROFILE if GNUPLOT is not defined). Note: The program can be configured to look first in the current directory, but this is not recommended because it is bad security practice.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top