有 gnuplot 配置文件吗?
我正在尝试设置 gnuplot,以便在启动时我始终使用逗号作为数据文件分隔符,使用以下命令:
set datafile separator ","
不幸的是,看起来 gnuplot 中没有 .gnuplotrc
的概念。 至少我在手册页中没有找到任何内容,而且我在这台机器上没有 strace 所以我我自己看不到。 我厌倦了每次启动 gnuplot 时都输入命令。 有人对此有好的解决方案吗? 请注意,使用 load
并不能解决我的问题:我仍然需要键入 load
命令。
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? Note that using load
does not solve my issue: I would still have to type the load
command.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
事实上,有一个 gnuplot 启动文件:它称为 .gnuplot,并且应该完全按照您的要求执行。 有关详细信息,请尝试在交互式 gnuplot 会话中运行
helpstart
。http://www.gnuplot.info/docs_4.2/gnuplot.html #x1-6900018
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.http://www.gnuplot.info/docs_4.2/gnuplot.html#x1-6900018
对于新版本的 gnuplot,请尝试以下操作:
使用 gnuplot 中的命令查看 gnuplotrc 文件的路径:
然后打开该文件并添加所需的命令。
Here is more info from the the [documentation][1] of the latest version(**4.6**):
当 gnuplot 运行时,它首先查找名为 gnuplotrc 的系统范围初始化文件。 该文件的位置在程序构建时确定,并由 show loadpath 报告。 然后,程序在用户的 HOME 目录中查找名为 .gnuplot(在类 Unix 系统上)或 GNUPLOT.INI(在其他系统上)的文件。 (Windows 和 OS/2 将在环境变量 GNUPLOT 中指定的目录中查找它;如果未定义 GNUPLOT,Windows 将使用 USERPROFILE)。 注意:可以将程序配置为首先在当前目录中查找,但不建议这样做,因为这是一种不好的安全做法。
For the new version of gnuplot try this:
See the path of the gnuplotrc file using the command within gnuplot:
Then just open the file and add the commands you want.
Here is more info from the the [documentation][1] 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.
一般在Windows上,主配置文件GNUPLOT.INI是通过gnuplotrc中的命令加载的。 这样你就可以改变GNUPLOT.INI的位置,
但是除了GNUPLOT.INI之外,还有一个单独的widows终端配置文件。 它称为 wgnuplot.ini,可以在 %APPDATA% 目录中找到。 如果不存在,您可以手动创建。
当您选择终端控制台右键菜单底部的“更新..”时,该文件会自动更新。 这样,您可以更改该终端的字体大小等。
Generally on windows, the main configuration file GNUPLOT.INI is loaded by a command in gnuplotrc. This way you can change the location of GNUPLOT.INI
But in addition to GNUPLOT.INI, there is also a separate configuration file for the widows terminal. It is called wgnuplot.ini and it can be found in the %APPDATA% directory. You can create it manually if it does not exist.
This file is updated automatically when you select "update .." at the bottom of the right-click menu of the terminal console. This way, you can change e.g. the font size of that terminal.