How to Call Gnuplot from Fortran to Plot Data Points?

  • Context: Fortran 
  • Thread starter Thread starter Abraham
  • Start date Start date
  • Tags Tags
    Fortran Gnuplot
Click For Summary
SUMMARY

To plot data points from Fortran using Gnuplot, utilize the "system" subroutine in Fortran 95. The command should be formatted as CALL SYSTEM('gnuplot'), which allows you to execute Gnuplot from within your Fortran code. This method is applicable for users operating on Windows while remotely connected to Unix machines. Ensure that Gnuplot is properly installed and accessible in your environment.

PREREQUISITES
  • Fortran 95 programming knowledge
  • Understanding of Gnuplot installation and usage
  • Familiarity with the "system" subroutine in Fortran
  • Basic command line operations on Windows and Unix
NEXT STEPS
  • Research Gnuplot scripting for advanced plotting techniques
  • Learn about data file formatting for Gnuplot compatibility
  • Explore error handling in Fortran when calling external programs
  • Investigate cross-platform compatibility issues between Windows and Unix for Fortran applications
USEFUL FOR

This discussion is beneficial for Fortran developers, data analysts, and researchers who need to visualize data outputs using Gnuplot in a cross-platform environment.

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.)
 

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
12K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K