Installing and Using PGPLOT in Windows



My experiments with pgplot continues. I think the installation is little tricky.

The problem is when we download the library we get so many files and folder and so many instructions, that most lose interest before even beginning.

So i created this small powerpoint to help anyone interested to install and use pgplot in windows.

This powerpoint explains the process of building and creating pgplot applications in fortran using intel fortran and qwin.

Installing and Using Pgplot in windows


Installing and Using Pgplot in windows

Tagged: ,

20 thoughts on “Installing and Using PGPLOT in Windows

  1. Clive Page September 23, 2011 at 8:59 pm Reply

    Useful, thanks. But (unless I missed something) the standard installation doesn’t give you interactive graphics on the screen, only to files. I wrote some notes on how to do this using the GrWin package

    Clive Page

    • sukhbinder September 24, 2011 at 4:32 pm Reply

      Thanks Clive. I am using intel fortran and use qwin to draw the graphics. And we get interactive graphics. In fact the pics in the posts are screen grab of the demos that come with Pgplot.

      Thanks for the link. Will have a look!

  2. collisionavoidance January 14, 2012 at 3:52 am Reply

    Dear Sukhbinder,

    Thanks a lot. I use dislin fortran library to embed plotting routines. Is pgplot better than dislin? Do you have any idea?


    • sukhbinder January 14, 2012 at 6:21 am Reply

      Thanks Priyankar, I have also used dislin library but not as much as pgplot. I am aiming to push Pgplot as much I can and when I hit a limit, I intend to see how dislin and other libraries do.

      Have you tried OpenGL fortran interface, the results look impressive!

  3. Anudeep Saha October 16, 2012 at 8:57 pm Reply

    Hi Sukhbinder,

    Thanks for the steps for installing PGPLOT in Windows.
    But I have got stuck in the step where one has to set “Use /assume:byterecl” in the Data Tab.

    I am using PGI’s Visual Fortran Compiler with VS2010 Shell and in the
    pgplot property pages->Fortran the “Data” option is not coming. So I am not able to set the “Use /assume:byterecl” option. I tried to compile the project without the “Use /assume:byterecl” option but it is giving errors.

    Is it possible if I get the pgplot.lib from the internet that I can test the demos?

    Thanks & Regards,

  4. cowlauncher October 6, 2013 at 9:55 pm Reply

    I have got stuck in 8th dia. How can i compiling?

    • sukhbinder October 6, 2013 at 10:05 pm Reply

      I hope you are using windows visual studio with fortran compiler. If yes then these steps are sufficient. You might want to search the blog for building and using the pgplot via command line. Good luck!

      • cowlauncher October 6, 2013 at 11:42 pm

        Succeeded! Thank you. I followed step by step the dias and i wanted to build and run pgdemo1.f and i got this:

        %PGPLOT, Unable to read font file: grfont.dat
        %PGPLOT, Use environment variable PGPLOT_FONT to specify the location of the PGPLOT grfont.dat file.
        Graphics device/type (? to see list, default /NULL):

        The grfont.dat file is in C:\pgplot

      • sukhbinder October 7, 2013 at 8:02 am

        Please keep the font file in the folder of the executable or set the environment variable pointing to the folder of the font file…….

  5. cowlauncher October 7, 2013 at 2:58 pm Reply

    I created a new enviroment variable PGPLOT_FONT and this is pointing to grfont.dat. But i dont know why, it doesn’t work.

    • sukhbinder October 7, 2013 at 4:00 pm Reply

      For testing, can you try placing the file in the same directory as the executable, if this works then there is a problem in setting the environment variable. If it doesn’t work, try building the font file again. There’s might be something wrong in that file. Hope this helps. Do let me know. Good luck

  6. cowlauncher October 7, 2013 at 4:24 pm Reply

    In pgpack.f, the next line is too long.
    OPEN (UNIT=2,STATUS=’NEW’,FORM=’UNFORMATTED’, FILE=’C:\pgplot\fonts\grfont.dat’)

    I tryed like this:


    Then the compiler write this:

    $ gfortran -c pgpack.f

    Error: Syntax error in OPEN statement at (1)

    Error: Invalid character in name at (1)

  7. max February 20, 2014 at 1:50 am Reply

    worderfull explanation …
    can do a guide to install pgplot under gfortran in code::blocks ide (win7 64b)

  8. Rach February 5, 2015 at 11:21 pm Reply

    This is an excellent explanation! I’d been struggling to get Pgplot to work in Intel Fortran and now it’s fixed! Thanks very, very much. R

    • sukhbinder February 6, 2015 at 6:52 am Reply

      You are welcome. Glad it helped.

  9. yakami March 11, 2015 at 12:46 am Reply

    I got stuck on slide 10. I do not have intel visual fortran and it is not free. Can I still install pgplot using cygwin and netbeans ? or what are the other options ?

    • sukhbinder March 11, 2015 at 6:47 am Reply

      I am not sure about the steps but yes it’s possible to install pgplot with gfortran outside Intel fortran. Please google I remember seeing an excellent resource on that

  10. Oksana August 4, 2015 at 6:13 pm Reply

    Very useful presentation,
    A question, if it is possible.
    Slide 9. Copy grfont.dat to the main folder. To my regret, I have only grfont.txt file.
    What’s is wrong?

    • sukhbinder August 4, 2015 at 11:08 pm Reply

      Hi Oksana. Thanks for reading and kind words. Please check slide 8, I think you might have missed adding the file name. And then compile the routine and run it.

      Please give it a try. Do let me know. I will check it again.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 837 other followers

%d bloggers like this: