Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

plot with fortran 1

Status
Not open for further replies.

albert1981

New member
Feb 16, 2007
61
Hallo every body,

there is any way to make a plot or a graph with fortran?

thanks,
Albert
 
Replies continue below

Recommended for you

That's a function of your compiler and its support libraries. You should read your maunal.

TTFN

FAQ731-376
 
Here is one approach. I wrote a program to do this for myself. I share it freely with others but it is limited in capability and there is no support. You can download a freeware plotting program called ES-Plot from:
You have your program write a data file containing the data to be plotted and use a system call to bring up the ES-plot program. Here is a simple example program that creates a data file of trig. functions:

integer i
real x
open(10,file='test.dat',status='unknown')
do i=1,20
x = i/20.*2.*3.14159
write(10,*) x, cos(x), sin(x), sin(x)*cos(x)
enddo
close(10)
call system('"c:\program files\esplot10\esplot.exe" test.dat')
end
 
If you're using the salford compiler, it has some built in plotting functions. If you're sticking to gnu there is something called gnuplot. As IRStuff says, it depends on your compiler. What compiler/OS are you using?
 
Hi there:

I do know that this is a Fortran Forum and that the desire is to do the plotting by using Fortan.

My suggestion is as follws: take the data to MS Office Suite and do quick plotting in either MS Excel and/or MS PowerPoint.

In no time you can get the plots. There is no programming involved and changes are quick. One can try out so many different built in options -- even custom made options are available.

In MS PowerPoint, one can create either GIF and/or JPG files from the polts and get them ready for presentations and web use.

Long time ago, when Fortran plotting was the only known option for me, I did lots of plotting by using Fortran. It does take some time to get it lined up.

Since MS Office Suite and other GUI plotting packages are available today, why not try to consider them as an option.

Here a few examples of MS Office Suite plots:

esc11.gif


esc41.gif


esc42.gif


esc43.gif


esc44.gif


Thanks,

Gordan Feric, PE
Engineering Software
 
Hallo everybody and thanks for the answers.

I just check now this forum.

I will try the differents options that you propose me but at the moment I was trying to use gnuplot. My OS is windows and I am trying to launch it from fortran like this:

h=system('D:\gpt35win\gnuplot> load"surface"')

where surface is the script where all the settings are. But it seems tht it doesn't work.


Thanks again,
Albert
 
Yes IRstuff,

load is a command of windows gnuplot. Do you know which command can be used to launch the gnuplot script from windows?

thanks,
Albert
 
To All:

My assumption is that you already have a data set that needs to be plotted.

Therefore, my suggestion is to move the data set to a Windows based application such as MS Office Suite and get it done in no time.

If you try to get it done through Fortan and its libraries, it will take some time and effort just to find out how it is done and then it vwill take some additional time to get it plotting correctly.

If I am not mistaken, the output Fortan files cannot be shared smoothly with other users ...

Thanks,

Gordan Feric, PE
Engineering Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor