GRAPHICS_EXAMPLES
Sample Graphics Programs


GRAPHICS_EXAMPLES, Python programs which illustrate how various kinds of data can be displayed and analyzed graphically.

Some common plot types include:

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages:

GRAPHICS_EXAMPLES programs are available in a C version and a C++ version and a dataset version and a FORTRAN90 version and a MATLAB version and an Octave version and a Python version.

Related Data and Programs:

GRAPHICS_EXAMPLES_CONVERT, examples which illustrate how various kinds of data can be processed and modified using the ImageMagick program convert() and its related tools.

GRAPHICS_EXAMPLES_GNUPLOT, examples which illustrate how various kinds of data can be displayed and analyzed graphically using the interactive executable graphics program gnuplot().

GRAPHICS_EXAMPLES_GRACE, examples which illustrate how various kinds of data can be displayed and analyzed graphically using the interactive executable graphics program grace().

GRAPHICS_EXAMPLES_PLOTLY1, examples which illustrate how various kinds of data can be displayed and analyzed graphically, using version 1 of the plotly() program from a browser.

Reference:

  1. Philipp Janert,
    Gnuplot in Action: Understanding Data with Graphs,
    Manning, 2010,
    ISBN13: 978-1-933988-39-8,
    LC: QA276.4.J37.
  2. Helmut Michels,
    The Data Plotting Software DISLIN - version 10.4,
    Shaker Media GmbH, January 2010,
    ISBN13: 978-3-86858-517-9.

Source Code:

CIRCLE_SCATTERS depicts 500 pairs of (X,Y) data points in the unit square, 395 of which lie inside the unit circle, and 105 outside. If possible, the "inside" points should be blue, the "outside" points red, and the circle itself should also be drawn. The matplotlib library is used.

CORKSCREW_PLOT3D generates (X,Y,Z) points on a curve, and makes a 3D line plot. When the plot is displayed, it can be rotated and zoomed in on. The PNG file is just a static snapshot. The matplotlib library is used.

DRUG_DOSAGE_PLOTS depicts measurements over 48 hours of the blood level concentration of a medicinal drug. The drug needs to reach a certain level to have an effect, but must not exceed the toxic level. A graphic is created which shows, on one plot, the concentration over time, the minimal effective level, and the maximum nonlethal leval. The matplotlib library is used.

GEYSER_BAR works with measurements of the waiting time in minutes between successive eruptions of the Old Faithful geyser. The data has been grouped into bins. The bin counts are displayed as a bar chart. The matplotlib library is used.

GRID_SURFACE records, on a 41x41 grid over [-2,2]x[-2,+2], the values z = exp(-(x^2+y^2)) * cos(0.25*x) * sin(y) * cos(2*(x^2+y^2)). The data is to be plotted as a surface. The matplotlib library is used.

LISSAJOUS_PLOT records 1000 points on a Lissajous curve defined by x=sin(3*t+pi/2), y=sin(4t). The curve is to be plotted and every tenth point marked. The matplotlib library is used.

LYNX_PLOT records the yearly lynx harvest from 1821 to 1934. The graph should plot the data points as circles, and connect consecutive data points with straight line segments to suggest a curve. The matplotlib library is used.

MARIO_FILL makes a simple image of Mario, by constructing a grid of squares filled with color. The matplotlib library is used.

ORBITAL_CONTOUR records, on a 101x101 grid over [0,4*pi]x[0,4*pi], the minimum distance between two planets given a pair of orbital angles. The data is presented as a color contour plot. The matplotlib library is used.

PREDATOR_PLOT3D generates values of time, prey, and predator populations, writes them to a file, and displays them in a 3D plot. A 3D plot of (time, rabbits, foxes) is created. The matplotlib library is used.

RANDOM_SCATTER generates 500 pairs of (X,Y) data, which lie in the unit square, and tend to cluster around (0.5,0.5). The matplotlib library is used.

Examples and Tests:

You can go up one level to the Python source codes.


Last modified on 28 April 2018.