Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Plot command in Fortran

Plot command in Fortran

Plot command in Fortran

Hello everybody;
Is there a plot command in fortran? I need to plot graphs directly from output files.

RE: Plot command in Fortran

Thanks IRstuff. really sometimes I need to plot results in order to show the shape of the graph and evaluate outputs. It is more practical than export results to an other grapher. I think it is possible with matlab.

RE: Plot command in Fortran

Depends which vendor's Fortran you are using. Some, like IVF and Silverfrost have built in Windows graphical routines if you work in a windows environment.

RE: Plot command in Fortran

Way back in the days of green and white stripped tractor feed printers, I wrote a plot routine with the help of an old Fortran book that used an asterisk character to make the plot. The idea was to make a 2 dimensional array of single digit characters. I used blanks, asterisks, and numbers to make the axis, then you print the array.

I have been called "A storehouse of worthless information" many times.

RE: Plot command in Fortran

Pretty much what IRstuff said is the best I think. Or... rather, just have your fortran code print the data to a simple ascii text output file in a clean format ( ie. spaces between the numeric entries on each line of data ).

You can then very, very easily copy/paste that data into Excel, split the data into individual cells and graph it. I do this type of thing a LOT! In general, to write code in fortran to do the graphics automatically takes a lot of time and effort. This effort is worth it for something you plan on using over and over again or that you wish to sell. But for one-off work, it usually represents a lot of time that you won't ever get back.

I think that most commercial fortran compilers come with additional abilities to do some graphics and such (these abilities are not part of the language standard though). You can also buy packages that work with your fortran to make graphics and such a lot easier. However, any way you slice it... even with nice graphics packages, writing the code to do the graphics neatly and correctly is often just as hard or harder than the code that did your engineering calculations for you and is thus... not worth the effort.

Dan smile

RE: Plot command in Fortran

Plotting in FORTRAN (and other common programming languages) can easily be done using for e.g. DISLIN a "A Data Plotting Library" (http://www.dislin.de/) (Max Planck Institute for Solar System Research)
"...DISLIN is a high-level and easy to use plotting library for displaying data as curves, bar graphs, pie charts, 3D-colour plots, surfaces, contours, and maps. The library contains about 500 plotting and parameter setting routines. The approach used is to have only a few graphics routines with short parameter lists. A large variety of parameter setting routines can then be used to create customized graphics. Several output formats are supported such as X11, VGA, PostScript, PDF, SVG, CGM, HPGL, TIFF, GIF, PNG and BMP. DISLIN is available for the programming languages C, Fortran 77, Fortran 90, Perl, Python and Java..."

You don't need a DISLIN license for a non-commercial use of DISLIN, otherwise a licence is available for low price.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close