fortran 调用 gnuplot

fortran 调用 gnuplot

同时参考 彭国伦 绘图

1.下载并安装gnuplot(http://gnuplot.info/),安装路径为d:/gnuplot
2.下载ogpf-0.12(http://mfort.codeplex.com/)。
3.新建console工程,加入ogpf-0.12解压缩后其中的demo.f90和ogpf.f90.编译,观察结果。

如果提示编译错误,请注意:
打开ogpf.f90,将其中的一段代码改为下面的代码:

IF (Persist) THEN
!Fortran standard recommend to use call execute_command_line to invoke another program
!from within Fortran, the old method was to use call system
!Here by default Fortran standard is used, if you have a compiler does not support
!call execute_command_line, uncomment the following call system
!CALL system('gnuplot -persist '//fileName) !Obsolete method, use with old compilers
CALL system('d:/gnuplot/bin/gnuplot -persist '//fileName) !Fortran standard
ELSE
!CALL system ('gnuplot '//fileName) !Obsolete method, use with old compilers
CALL system ('d:/gnuplot/bin/gnuplot '//fileName)
END IF

 

重新编译即可!


效果:
<ignore_js_op>
<ignore_js_op>
<ignore_js_op>
<ignore_js_op>

posted @ 2022-03-19 21:46  airplane-design  阅读(286)  评论(0)    收藏  举报