zoukankan      html  css  js  c++  java
  • gnuplot配置HOME目录

    http://blog.csdn.net/jspenliany/article/details/39828261

      本人使用gnuplot绘图,使用console version的来进行处理的时候,经常需要切换目录,非常麻烦。希望有个办法让gnuplot在启动的时候,进入我的gnuplot工作目录。(至于gnuplot的默认work directory可以参考 help startup)      

             HOME目录有那么重要么?

             答案是肯定的,因为gnuplot的所有命令都仅在当前工作目录(指令pwd输出的就是当前工作目录)下起作用,即在所有的绘图指令中,涉及到数据读取,gnuplot都会在当前工作目录下寻找,如果数据文件不在这。gnuplot就报数据异常!!

             怎么办呢?  去百度搜索,结果。。。。。。(难道我的搜索不对,你懂得。。。。。。)

            在console version中,输入命令:pwd(Print Work Directory) 输出的是  当前的工作区。也就是说:gnuplot的命令涉及到的文件,在默认情况下都是在这个目录下的。(根据在console中输入:help startup。获知,gnuplot在install的过程中,会有个配置文件生成;gnuplot每次启动都会读取配置信息,因而理论上, 所有在console中输入的命令在 配置文件中均可以使用。但一般不推荐这么做。)

            我的系统是WIN7 64bit,gnuplot4.6

            怎么说呢,gnuplot的工作目录在安装过程中是存在默认值的,如何修改呢? 一种方法就是  cd命令(change directory)。另外就是在gnuplot加载过程中,修改工作目录。

             一般情况下(针对WIN7平台),在gnuplot的安装目录中 gnuplot/share/下有个gnuplotrc文件。这个文件的默认内容如下:

    [plain] view plain copy
     
     在CODE上查看代码片派生到我的代码片
    1. ###  
    2. ### Gnuplot version 4.6 intialization file  
    3. ### This file is loaded by gnuplot at the start of each run.  
    4. ### It is provided as a template, with all commands commented out.  
    5. ### Uncomment and customize lines for local use.  
    6. ### Any commands placed here will affect all users.  
    7. ### To customize gnuplot's initial state for an individual user,  
    8. ### place commands in a private file ~/.gnuplot instead.  
    9.   
    10. ###  
    11. ### Language initialization  
    12. ###  
    13. # set locale  
    14. # set encoding locale  
    15.   
    16. ###  
    17. ### Default line colors and repeat cycle  
    18. ###  
    19. # set linetype 1 lc rgb "dark-violet" lw 1  
    20. # set linetype 2 lc rgb "#009e73" lw 1  
    21. # set linetype 3 lc rgb "#56b4e9" lw 1  
    22. # set linetype 4 lc rgb "#e69f00" lw 1  
    23. # set linetype 5 lc rgb "#f0e442" lw 1  
    24. # set linetype 6 lc rgb "#0072b2" lw 1  
    25. # set linetype 7 lc rgb "#e51e10" lw 1  
    26. # set linetype 8 lc rgb "black"   lw 1  
    27. # set linetype cycle 8  
    28.   
    29. ###  
    30. ### Initialize the default loadpath for shared gnuplot scripts and data.  
    31. ### Please confirm that this path is correct before uncommented the line below.  
    32. ###  
    33.   
    34. ###  
    35. ### Some commonly used functions that are not built in  
    36. ###  
    37. # sinc(x) = sin(x)/x  
    38.   
    39. ###  
    40. ### Other preferences  
    41. ###  
    42. # set clip two  

    这个文件就是 gnuplot加载过程中,读取的配置文件。

    在这个文件中,有这样两行:

    [plain] view plain copy
     
     在CODE上查看代码片派生到我的代码片
    1. ###  
    2. ### Initialize the default loadpath for shared gnuplot scripts and data.  
    3. ### Please confirm that this path is correct before uncommented the line below.  
    4. ###  

    这句话是说,通过配置默认loadpath,添加gnuplot 脚本和数据文件的存放目录。通俗的讲,配置了这个loadpath之后,loadpath所指向的文件夹将能够被gnuplot作为工作目录。

    cd  "D:\XXX\XXX\XXX"  注意了:目录划分符号为'\' 。这一行命令能够实现gnuplot的工作目录。

    PS :在寻找解决方法的过程中 ,参照了 google的检索结果。  也许你的系统版本,gnuplot版本和我不同,对应的初始化文件名可能不同。

  • 相关阅读:
    HDU 1025 Constructing Roads In JGShining's Kingdom (DP+二分)
    HDU 1158 Employment Planning
    HDU 2059 龟兔赛跑
    Csharp 简单操作Word模板文件
    Csharp windowform datagridview Clipboard TO EXCEL OR FROM EXCEL DATA 保存datagridview所有數據
    Csharp 讀寫文件內容搜索自動彈出 AutoCompleteMode
    Csharp windowform controls clear
    CSS DIV大图片右上角叠加小图片
    Csharp DataGridView自定义添加DateTimePicker控件日期列
    Csharp 打印Word文件默認打印機或選擇打印機設置代碼
  • 原文地址:https://www.cnblogs.com/zkwarrior/p/5818429.html
Copyright © 2011-2022 走看看