next up previous contents index
Next: 7.9 Plotting time-series along Up: 7. Cook-book Previous: 7.7 A simple location   Contents   Index


7.8 A 3-D histogram

The program psxyz allows us to plot three-dimensional symbols, including columnar plots. As a simple demonstration, we will convert a gridded netCDF of bathymetry into an ASCII $xyz$ table and use the height information to draw a 2-D histogram in a 3-D perspective view. Our gridded bathymetry file is called topo.grd and covers the region from 0 to 5 $^{o}$E and 0 to 5 $^{o}$N. Depth ranges from -5000 meter to sea-level. We produce the illustration by running this command:





#!/bin/csh
#        GMT EXAMPLE 08
#
#        $Id: job08.csh,v 1.5 2004/04/10 17:19:14 pwessel Exp $
#
# Purpose:    Make a 3-D bar plot
# GMT progs:    grd2xyz, pstext, psxyz
# Unix progs:    echo, rm
#
grd2xyz guinea_bay.grd >! $$
psxyz $$ -B1/1/1000:"Topography (m)"::.ETOPO5:WSneZ+ -R-0.1/5.1/-0.1/5.1/-5000/0 \
   -P -JM5i -JZ6i -E200/30 -So0.0833333ub-5000 -U"Example 8 in Cookbook" -W0.25p -Glightgray -K >! \
   example_08.ps
echo '0.1 4.9 24 0 1 TL This is the surface of cube' | pstext -R -J -JZ -Z0 -E200/30 -O \
   >> example_08.ps
\rm -f $$ .gmt*





The output can be viewed in Figure 7.8.

Figure 7.8: A 3-D histogram.
\begin{figure}\centering\epsfig{figure=eps/GMT_example_08.eps}\end{figure}


next up previous contents index
Next: 7.9 Plotting time-series along Up: 7. Cook-book Previous: 7.7 A simple location   Contents   Index
Paul Wessel 2004-10-01