Exemplo n.º 1
0
# Get a default layout for plotting.
# This produces a FrameLayout, a layout built of five widgets,
# a 'center' widget, surrounded by four widgets for the margins:
#
#          +---------------------------+
#          |             top           |
#          +---------------------------+
#          |      |            |       |
#          | left |   center   | right |
#          |      |            |       |
#          +---------------------------+
#          |           bottom          |
#          +---------------------------+

layout = gmt.default_layout()

# We will plot in the 'center' widget:
plot_widget = layout.get_widget('center')


# Set width of plot area to 8 cm and height of the 'top' margin 
# to 1 cm. The other values are calculated automatically.
plot_widget.set_horizontal( 8*cm )
layout.get_widget('top').set_vertical( 1*cm )

# Define how the widget's output parameters are translated
# into -X, -Y and -J option arguments. (This could be skipped
# in this example, because the following templates
# are just the built-in defaults)
plot_widget['X'] = '-Xa%(xoffset)gp'