Run PLplot on the Cluster¶
- PLplot is a library of subroutines that are often used to make scientific plots in compiled languages such as C, C++, D, Fortran, Ada, OCaml and Java. PLplot can also be used interactively by interpreted languages such as Octave, Python, Perl and Tcl.
- This guide will cover how to run PLplot on the Cluster and display the generated plot.
- You can find PLplot's homepage here.
- You can see examples in all the different languages PLplot supports here.
- In this guide we will run PLplot in python as an example. Using an interpreted language allows us to run PLplot interactively, but for the purposes of this guide, we will generate a 2D line plot with no interactive elements.
- Since PLplot is a graphical application, we will need to run it either a VNC session or through an X11 server. Please refer to the VNC guide or X11 guide for more information.
Walkthrough: Run PLplot on the Cluster¶
- This walkthrough will use Python and PLplot to generate a 2D line plot that will be viewed through VNC.
- The code used in this example comes from PLplot's GitHub repo.
- plplotTest.py can be found here
- plplotTestViewer.py can be found here
- You can transfer the file to your account on the cluster to follow along. The file transfer guide may be helpful.
Part 1: Set up VNC Session¶
- Please see the VNC guide for instructions on how to set up the Interactive VNC session
Part 2: Load and Start PLplot on VNC¶
- Open terminal in the VNC window by clicking top left
System Tools> scroll down to
- All commands here on will be typed in terminal in VNC.
- You will need to load the PLplot module and the Python 2.7 module.
- You can find which versions are available for any module with
module avail [software].
- Run the following commands to load the necessary modules:
module load python/2.7
module load plplot/5.9.9
- Navigate to the directory containing the
plplotTestViewer.pyfiles which create and display the graph, respectively.
- View the graph with
- You will be prompted with the following:
Plotting Options: < 1> xwin X-Window (Xlib) < 2> tk Tcl/TK Window < 3> ps PostScript File (monochrome) < 4> psc PostScript File (color) < 5> xfig Fig file < 6> null Null device < 7> tkwin New tk driver < 8> mem User-supplied memory device < 9> svg Scalable Vector Graphics (SVG 1.1) <10> bmpqt Qt Windows bitmap driver <11> jpgqt Qt jpg driver <12> pngqt Qt png driver <13> ppmqt Qt ppm driver <14> tiffqt Qt tiff driver <15> svgqt Qt SVG driver <16> qtwidget Qt Widget <17> epsqt Qt EPS driver <18> pdfqt Qt PDF driver <19> extqt External Qt driver <20> memqt Memory Qt driver <21> xcairo Cairo X Windows Driver <22> pdfcairo Cairo PDF Driver <23> pscairo Cairo PS Driver <24> svgcairo Cairo SVG Driver <25> pngcairo Cairo PNG Driver <26> memcairo Cairo Memory Driver <27> extcairo Cairo External Context Driver Enter device number or keyword:
- Enter 1
- You should see a display that looks like the following:
- Congratulations! You successfully ran PLplot on the cluster.