Fortran How to Call Gnuplot from Fortran to Plot Data Points?

  • Thread starter Thread starter Abraham
  • Start date Start date
  • Tags Tags
    Fortran Gnuplot
Click For Summary
To plot data points from a Fortran program using gnuplot, the "system" subroutine can be utilized. By calling "CALL SYSTEM(gnuplot)" within the Fortran code, users can execute gnuplot commands directly from the Fortran environment. This approach allows for seamless integration of Fortran output with gnuplot for visualization. The discussion highlights the compatibility of this method with Fortran95 and the gfortran compiler, specifically in a Windows environment while accessing Unix machines remotely.
Abraham
Messages
68
Reaction score
0
hello. I have a fortran code that has data points as output.

How do I get fortran to plot these data points using gnuplot?

Is there a way to call the external program from within fortran?

I am using fortran95, gfortran compiler. I'm on a windows machine, but
I'm connected remotely to the Unix machines in the lab.

Thanks,

Abraham
 
Technology news on Phys.org
Hi Abraham,

Try using the "system" subroutine.

Code:
CALL SYSTEM(gnuplot )

Whatever you put inside the parentheses gets passed to the command line (or terminal depending on your os.)
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
8K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 59 ·
2
Replies
59
Views
11K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K