using GMT
G = gmt("grdmath -R-15/15/-15/15 -I0.5 X Y HYPOT DUP 2 MUL PI MUL 8 DIV COS EXCH NEG 10 DIV EXP MUL =");
cmap = grd2cpt(G); # Compute a colormap with the grid's data range
bar3(G, lw=:thinnest, color=cmap, show=true)
Plots a 3D bar graph. The input can either be a file name of a file with at least three columns (x,y,z), but optionally more, a GMTdatset object with also three or more columns. However, the simplest usage is to provide a grid object (a GMTgrid) or a MxN matrix (with M,N > 3) and accept the defaults set for these data types. When not using grids or matrices the width keyword (see below) is mandatory, unless both xsize and ysize are given as two extra data columns. When using file names, however, it is necessary to tell the program if it is going to read a grid or a table. That is achieved by using grd=true or dataset=true, respectively.
This module is a subset of plot to make it simpler to draw 3D bar plots. So not all (fine) controlling parameters are listed here. For a finer control, user should consult the plot module.
B or axes or frame
Set map boundary frame and axes attributes. Default is to draw and annotate left, bottom and vertical axes and just draw left and top axes. More at [frame](../common_opts/opt_B.html)
J or proj or projection : – proj=
Select map projection. More at [proj](../common_opts/opt_J.html)
R or region or limits : – limits=(xmin, xmax, ymin, ymax, zmin, zmax) | limits=(BB=(xmin, xmax, ymin, ymax, zmin, zmax),) | …more
Specify the region of interest. Default limits are computed from data extents. More at [limits](../common_opts/opt_R.html)
G or markerfacecolor or MarkerFaceColor or markercolor or mc or fill
Select color or pattern for filling of symbols [Default is no fill]. Note that plot will search for fill and pen settings in all the segment headers (when passing a GMTdaset or file of a multi-segment dataset) and let any values thus found over-ride the command line settings (but those must be provided in the terse GMT syntax). See [Setting color](../common_features/color.html) for extend color selection (including color map generation).
bar
column (3-D) extending from base to z. By default, base is 0 and the bar widths are 0.85 of the width in x-units. You can change this by using (in alternative):
cm, inch or point.cm, inch or point.p or view or perspective : – view=(azim, elev)
Default is viewpoint from an azimuth of 200 and elevation of 30 degrees.
Specify the viewpoint in terms of azimuth and elevation. The azimuth is the horizontal rotation about the z-axis as measured in degrees from the positive y-axis. That is, from North. This option is not yet fully expanded. Current alternatives are:
bar3!) More at [perspective](../common_opts/opt_p.html)figname or savefig or name : – figname=name.png
Save the figure with the figname=name.ext where ext chooses the figure image format.
View a grid as a 3D bar plot