Gnuplot – Plotting Program

drop_d


Gnuplot
is a portable command-line driven graphing utility for Linux, OS/2, MS Windows, OSX, VMS, and many other platforms. The source code is copyrighted but freely distributed (i.e., you don’t have to pay for it). It was originally created to allow scientists and students to visualize mathematical functions and data interactively, but has grown to support many non-interactive uses such as web scripting

Gnuplot can be downloaded from previous link or from: softpedia gnuplot

* * *

Here is an example for plotting the time history shown above using the following files:

Gnuplot command file:  plot_drop.plt

Time history:  drop.txt

* * *

Here is an example for generating a graph with two subplots using the multiplot command.

Gnuplot command file:  plot_drop_multiplot.plt

Time histories:  drop.txt  &  drop_velox.txt

Here is an alternate example that plots the two curves in separate windows:  plot_drop_2.plt

* * *

The follow command is then entered into the gnuplot window:

gnuplot>load “plot_drop.plt”

* * *

The drop_plot.plt file also generates a corresponding png file as shown at the beginning of this post.

The  above plot was made using Gnuplot Version 4.6 patchlevel 3.

The png file can be accessed by other applications but may require the following command first depending on the application, operating system, etc.

gnuplot>clear

* * *

Here is an example for plotting a power spectral density in log-log format, with some manually added tics.

Data file: plate.psd

Gnuplot file: plot_psd.plt

gnuplot>load “plot_psd.plt”

* * *

Here is an example for plotting a shock response spectrum with two curves and a legend.

Data file:  half_sine_srs.txt

Gnuplot file:  plot_srs.plt

gnuplot> load “plot_srs.plt”

* * *

Here is an example for calling gnuplot from within a Fortran program running in Ubuntu:  fortran_gnuplot_demo.f

The key code line is:

CALL SYSTEM(‘gnuplot gnuplot_demo.plt -persist’)

* * *

See also:  Python & Gnuplot

* * *

– Tom Irvine

2 thoughts on “Gnuplot – Plotting Program

  1. Pingback: Ubuntu Plotting Programs | Vibrationdata

  2. Pingback: Python & Gnuplot | vibrationdatapython

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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