Skip to main content Skip to navigation

Part Five - Installing gnuplot

This has not received proper testing yet...
  1. Close Cygwin if it is running.
  2. Run Cygwin Setup.
  3. Click on "Next" until you reach the "Select Packages" screen.
  4. Find the "Math" (which is American for Maths) entry (about halfway down the list).
  5. Click on the plus sybol, and some sub entries should appear.
  6. Find the "gnuplot" entry and click on the text "Default" which should change to say "install"
  7. Click on the next button, and let Cygwin download and install gnuplot.
  8. To check the installation of gnuplot worked, run your "Start X Windows" shortcut (created in Part 4)
  9. At the prompt, type gnuplot and press enter.
  10. You should see something like this:

    Screenshot

  11. At the gnuplot prompt, try typing plot sin(x) and press enter.
  12. You should get a graph of the function appearing in a new window, like this:

    Screenshot

  13. Try resizing the graph window, and maximising it. Notice it will automatically resize.
  14. Try zooming in by using the right mouse button.
  15. Try typing splot x*x-y*y and press enter. The command splot (special plot?) is used for 3D graphs, in this case f(x,y) = x^2 - y^2.
  16. You should get a graph like this:

    Screenshot

  17. Again try resizing the graph window.
  18. Try rotating the figure using the left mouse button (left click and move the mouse left and right).
  19. Try adjusting the viewpoint using the left mouse button (left click and move the mouse up and down).
  20. Try adjusting the vertical scale using the middle mouse button (middle click and move the mouse up and down).
  21. Try zooming by using the middle mouse button (middle click and move the mouse left and right).
  22. Close the graph windows
  23. Type "exit" at the gnuplot prompt to exit the gnuplot program.
  24. Close Cygwin

For more help using gnuplot interactively like this, I suggest you turn to Google.

There is also more documentation at the official home page, www.gnuplot.info.

P.S. - Using the Windows Command Prompt
As long as the X Windows server is running (its started when you run the "Start X Windows" shortcut) you can run gnuplot from the Windows Command Prompt (instead the Cygwin prompt). You can tell if the X Windows server is running by looking for its icon in the Windows System Tray (bottom right of screen):

Screenshot

Example of gnuplot being used from the windows command prompt:

Screenshot


Next up, Part Six - Using gnuplot from a C++ Program.