# plot graph

**URL:** <https://forums.developer.nvidia.com/t/plot-graph/132809>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [March 3, 2012, 6:53am UTC](https://forums.developer.nvidia.com/t/plot-graph/132809 "2012-03-03T06:53:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kuldeep\_gupta](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@kuldeep\_gupta](https://forums.developer.nvidia.com/u/kuldeep_gupta)\
**Post date:** [March 3, 2012, 6:53am UTC](https://forums.developer.nvidia.com/t/plot-graph/132809/1 "2012-03-03T06:53:22Z")

</div>

how to draw a x-y plot in fortran using this compiler

---

<div class="post-metadata">

**Author:** ![mecej41](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mecej41](https://forums.developer.nvidia.com/u/mecej41)\
**Post date:** [March 3, 2012, 7:11pm UTC](https://forums.developer.nvidia.com/t/plot-graph/132809/2 "2012-03-03T19:11:26Z")

</div>

> [@kuldeep gupta](#):
>
> how to draw a x-y plot in fortran using this compiler

Plotting (and, more generally, controlling devices) is outside the scope of Fortran.

You may output a text or “binary” stream from a Fortran program, either directly (e.g., PostScript output, GNUPlot commands, CalComp commands, HP-GL) or through an API (e.g., an image format such as JPEG). There are raster-oriented APIs, and there are vector-oriented APIs.

Search on “GNUPLOT”, “PSPLOT”, “DISLIN”, etc.

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [March 5, 2012, 5:38pm UTC](https://forums.developer.nvidia.com/t/plot-graph/132809/3 "2012-03-05T17:38:00Z")

</div>

Hi kuldeep gupta,

You can use OpenGL to create basic plots. There are few interface libraries which can help. While I wrote this [guide to building F90gl](http://www.pgroup.com/resources/f90gl/f90gl129_pgi60.htm) for the PGI 6.0 compilers, it’s still valid for our latest versions. There is also newer F03gl library ([F03GL: Fortran interface to OpenGL](http://www-stone.ch.cam.ac.uk/pub/f03gl/index.xhtml)), but I have not personally used it.

If you need an example program, I used F90gl as part of my CUDA Fortran “Games of Life” program found in this article: [Account Login | PGI](http://www.pgroup.com/lit/articles/insider/v3n3a2.htm).

- Mat
