| Method Summary |
| |
__init__(self,
template,
nancolor,
headerfontsize,
labelfontsize,
latmin,
latmax,
lonmin,
lonmax,
proj,
longrdinc,
latgrdinc,
xsize,
ysize,
xyunits,
xshift,
yshift,
centerlon,
centerlat,
lonframeinc,
latframeinc,
lonlabelinc,
latlabelinc,
axisfontsize,
verbose,
standardpar1,
standardpar2,
rectbounds,
reverseyaxis,
basemaptype)
create GMT class instance, set default values for instance variables
and initialized postscript drawing area. |
| |
basemap(self)
draw basemap, grid lines and titles. |
| |
close(self,
fixbb,
addtrailer,
psfilename,
view)
close the postscript file, optionally add trailer, fix bounding box
and render the plot. |
| |
command(self,
gmt_command_string,
force_command)
Send a raw command to GMT core. |
| |
contour(self,
grdfile)
draw contours and optional labelbar. |
| |
drawcurve(self,
lats,
lons,
thickness,
color)
draw a curve on the map from coordinates provided in lats, lons. |
| |
drawline(self,
latbegin,
lonbegin,
latend,
lonend,
thickness,
color,
greatcircle)
draw a line on the map from coordinates latbegin/lonbegin to
latend/lonend. |
| |
drawpolygon(self,
lats,
lons,
linethickness,
linecolor,
fillcolor)
draw a closed polygon on the map from coordinates provided in lats,
lons. |
| |
drawsymbol(self,
lat,
lon,
symbol,
size,
color)
draw a symbol on the map at coordinates lat/lon. |
| |
drawtext(self,
textstring,
x,
y,
offset,
fontsize,
justify,
angle,
font,
color,
clip)
draw a text string on the map at coordinates x,y. |
| |
latlontoxy(self,
lat,
lon)
convert lat/lon to x/y. |
| |
setmapparms(self)
set up GMT map parameters for projection, grid lines etc. |
| |
windbarbs(self,
ugrd,
vgrd)
draw wind barbs on map. |
| |
wrtgrd(self,
data,
x,
y,
title,
scale,
offset,
addcyclicpt,
xunit,
yunit,
zunit,
node_offset,
zname)
write a Numeric array to a grd file suitable for GMT. |
| |
xytolatlon(self,
x,
y)
convert x/y to lat/lon. |
| Instance Variable Summary |
| |
alldashed: False | draw all contours dashed. |
| |
axisfontsize: 16 | fontsize for axis name labels. |
| |
barbangle: 120 | angle between wind barb and pillar. |
| |
barblength: "0.2i" | wind barb pillar length (units appended). |
| |
barbscale: 5 | magnitude corresponding to full wind barb. |
| |
barbwidth: "0.1i" | wind barb length (note units are appended). |
| |
boxfill: False | if true, draw grid-box filled image instead of filled
contours. |
| |
centerlat: 0 only used if proj in ['ortho','la','merc','gst'] or
rectbounds: True, set to 0.5*(latmin+latmax) otherwise | latitude of projection
center. |
| |
centerlon: 0 only used if proj = "ortho" or rectbounds:
True, set to 0.5*(lonmin+lonmax) otherwise | longitude of projection
center. |
| |
cint: None | contour interval (uses numlevs to chose if not set). |
| |
clabels: True | draw contour labels. |
| |
clipbarb: True | clip wind barbs at edge of map. |
| |
coastlines: True | draw coastlines. |
| |
coastres: 'c' | Resolution of coastline database to use ('c','l','m','h', or
'f'). |
| |
coastsmooth: 10000 | Coastline features with an area smaller than this number (in
km^2) will not be plotted. |
| |
coastthick: 2.0 | thickness to draw coastlines. |
| |
colormap: "polar" | name of built-in GMT colormap for color-fill (run
'makecpt' without args to see choices) A filename for a custom cptfile
can also be given (see GMT docs for information on cptfile format). |
| |
continentfill: False | fill continents. |
| |
continentfillcolor: 200 | grayscale color or rgb tuple to fill continents. |
| |
continents: False | draw or fill continents and coastlines. |
| |
contourcolor: (0,0,0) | color for contours (default black). |
| |
contourfill: False | color-fill contours. |
| |
countries: False | draw country boundaries (including states in North
America). |
| |
countrythick: 1.0 | thickness to draw states. |
| |
cthick: 0.5 | contour line thickness |
| |
drawclines: True | draw contour lines. |
| |
eaxis: True | draw east (right) axis. |
| |
elabels: False | draw labels on east (right) axis. |
| |
headerfontsize: 18 | default fontsize for main, right and left titles. |
| |
labelbar: True | draw a labelbar if contourfill or boxfill=True. |
| |
labelbararrows: True | if true, draw arrows at labelbar ends |
| |
labelbarheight: horizontal bar: yshift/6 OR vertical bar: xsize/25| height of labelbar (in xyunits) (in vertical case, height
designate width...) |
| |
labelbarinc: 2 | label lablelbar every labelbarinc levels. |
| |
labelbarlength: horizontal bar: 0.9*xsize OR vertical bar: 0.9*ysize |
length of labelbar (in xyunits) |
| |
labelbarorient: 'h' | set labelbar orientation. |
| |
labelbartitle: None | title for labelbar - size given by axisfontsize. |
| |
labelbartitle_offset: 0.1 | offset for labelbar title (in xyunits) |
| |
labelbarxpos: horizontal bar: 0.5*xsize OR vertical bar :xshift+1.05*xsize |
x position of labelbar center (in xyunits) |
| |
labelbarypos: horizontal bar: -yshift/3 OR vertical bar:ysize*0.5 | y position of labelbar top (in
xyunits) |
| |
labelfontsize: 12 | fontsize for axis value labels. |
| |
labinc: 2 | label contours every labinc levels. |
| |
latframeinc: 3 (if proj in ['loglinear','loglog']), otherwise
latlabelinc if defined, latgrdinc if not | Increment for ticks on
latitude axis. |
| |
latgrdinc: getcint(latmin,latmax,6) | grid increment for latitude
axis. |
| |
latlabelinc: 2 (if proj in ['loglinear','loglog']), otherwise latframeinc if defined, latgrdinc if not | Increment for latitude
axis labels. |
| |
latmax: 90 | maximum latitude (or y axis value). |
| |
latmin: -90 | minimum latitude (or y axis value). |
| |
lefttitle: None | left title string. |
| |
lefttitlefont: 0 | left title font (integer or string, run 'pstext -L' for
options. |
| |
lefttitlefontsize: headerfontsize | left title font size. |
| |
lonframeinc: 3 (if proj in ['loglinear','loglog']), otherwise
lonlabelinc if defined, longrdinc if not | Increment for ticks on
longitude axis. |
| |
longrdinc: getcint(latmin,latmax,6) | grid increment for longitude
axis. |
| |
lonlabelinc: 2 (if proj in ['loglinear','loglog']), otherwise
lonframeinc if defined, longrdinc if not | Increment for longitude
axis labels. |
| |
lonmax: 360 | maximum longitude (or x axis value). |
| |
lonmin: 0 | miniumum longitude (or x axis value). |
| |
ltitleypos: chosen internally to be near upper left side of map | location of left
title string. |
| |
ltitleyshift: ysize/15 | vertical displacement of left
title above map. |
| |
maintitle: None | main title string. |
| |
maintitlefont: 0 | main title font (integer or string, run 'pstext -L' for
options. |
| |
maintitlefontsize: headerfontsize | main title font size. |
| |
mapscale: False | Draw a simple map scale. |
| |
mapscalelatlon: False | specify position of map scale in lon/lat instead of x/y. |
| |
mapscalelength: approx 1/5 zonal scale of plot | length of map scale in km. |
| |
mapscalestyle: 'p' | 'p' for plain style, 'f' for fancy. |
| |
mapscalexpos: xsize*4/5 | x-position of map scale. |
| |
mapscaleypos: ysize/10 | y-position of map scale. |
| |
maxlevel: default is min value of data | maximum contour level desired (if symmetriclevels=True, minlevel and maxlevel
set to max(abs(minlevel),abs(maxlevel)). |
| |
minlevel: default is min value of data | minimum contour level desired. |
| |
missvalue: = 1.e20 ! data points greater than (less than if negative) this value
are treating as missing and are set to NaN. |
| |
mtitleypos: chosen internally to be near center of map, above right and left title
| location of main title string |
| |
mtitleyshift: ysize/7 | vertical displacement of main
title above map. |
| |
nancolor: (255,255,255) | color to fill NaN regions (default is white). |
| |
naxis: True | draw north (top) axis. |
| |
negcontourcolor: contourcolor | optional separate color for
negative contours. |
| |
negdashed: False | draw negative contours as dashed lines. |
| |
nlabels: False | draw labels on north (top) axis. |
| |
nozero: False | do not draw zero contour. |
| |
numlevs: 15 | approx number of contour intervals desired (if cint not
given, numlevs will be used to determine contour intervals). |
| |
oceanfill: False | fill oceans. |
| |
oceanfillcolor: 200 | grayscale color or rgb tuple to fill oceans. |
| |
poscontourcolor: contourcolor | optional separate color for
positive contours. |
| |
posdashed: False | draw positive contours as dashed lines. |
| |
proj: 'cyl' | map projection (valid choices 'linear','loglinear','loglog',
'cyl' - cylindrical equidistant, 'npst' - North Polar Stereographic,
'spst' - South Polar Stereographic, 'lc' - Lambert Conformal Conic, 'la'
- lambert azimuthal, 'merc'- mercator, 'ortho' - Orthographic), and 'gst'
- general stereographic. |
| |
psview: "gs -q -dBATCH" | command for viewing postscript output
(invoked when view=True in call to close method). |
| |
rectbounds: False | if true latmin,lonmin
is interpreted as lower left corner of rectangular map, latmax,lonmax
upper right. |
| |
reversecolormap: False | reverse the colors in the given colormap. |
| |
reverseyaxis: False | reverse direction of y-axis for non-geographic map projections
so that values decrease upwards (useful when depth or pressure is
y-axis). |
| |
righttitle: None | right title string. |
| |
righttitlefont: 0 | right title font (integer or string, run 'pstext -L' for
options. |
| |
righttitlefontsize: headerfontsize | right title font size. |
| |
rtitleypos: chosen internally to be near upper right side of map | location of
right title string. |
| |
rtitleyshift: ysize/15 | vertical displacement of right
title above map. |
| |
saxis: True | draw south (bottom) axis. |
| |
skipbarbx: 1 | grid points to skip drawing wind barbs in longitudinal direction
(1 means every wind barb is drawn). |
| |
skipbarby: 1 | | grid points to skip drawing wind barbs in latitudinal direction
(1 means every wind barb is drawn). |
| |
slabels: False | draw labels on south (bottom) axis. |
| |
stamp: None | Unix time stamp plotted with specified text. |
| |
stampxpos: 0 | x position of Unix time stamp. |
| |
stampypos: -yshift/5 | y position of Unix time
stamp. |
| |
standardpar1: lonmin + (1/6)*(lonmax-lonmin) | 1st standard parallel (only
relevant if proj = 'lc'). |
| |
standardpar2: lonmin + (5/6)*(lonmax-lonmin) | 2nd standard parallel (only
relevant if proj = 'lc'). |
| |
symmetriclevels: False | force contour levels to be symmetric about zero. |
| |
uscastatesonly: False | draw only us and canada state boundaries. |
| |
usstatesonly: False | draw only us state political boundaries. |
| |
verbose: False | if true, print all GMT commands. |
| |
waxis: True | draw west (left) axis. |
| |
wlabels: False | draw labels on west (left) axis. |
| |
xaxislabel: "" | x-axis label (only used for proj='loglinear', 'linear', and
'loglog'. |
| |
xshift: 0 | offset plot in horizontal (units given by xyunits). |
| |
xsize: 6.5 | width of plot (in units given by xyunits). |
| |
xyunits: "i" | page measurement units (can be cm ('c'), inch ('i'),
meter ('m'), or point ('p')). |
| |
yaxislabel: "" | y-axis label (only used for proj='loglinear', 'linear', and
'loglog'. |
| |
yshift: xsize/4 | offset plot in vertical (units
given by xyunits) Set when class instance is
created. |
| |
ysize: 6.5 | height of plot (in units given by xyunits). |
| |
zerocontourcolor: contourcolor | optional separate color for
zero contour. |
| |
zerothick: 1.5 | thickness of zero contour. |
__init__(self,
template=None,
nancolor=(255, 255, 255),
headerfontsize=18,
labelfontsize=12,
latmin=-90,
latmax=90,
lonmin=0,
lonmax=360,
proj='cyl',
longrdinc=None,
latgrdinc=None,
xsize=6.5,
ysize=6.5,
xyunits='i',
xshift=0,
yshift=0,
centerlon=0,
centerlat=0,
lonframeinc=None,
latframeinc=None,
lonlabelinc=None,
latlabelinc=None,
axisfontsize=16,
verbose=False,
standardpar1=None,
standardpar2=None,
rectbounds=False,
reverseyaxis=False,
basemaptype='plain')
(Constructor)
create GMT class instance, set default values for instance variables
and initialized postscript drawing area.
-
- Keyword Parameters:
nancolor -
(255,255,255) | color to fill NaN regions (default is
white).
headerfontsize -
18 | default fontsize for main, right and left titles.
labelfontsize -
12 | fontsize for axis value labels.
axisfontsize -
16 | fontsize for axis name labels.
xsize -
6.5 | width of plot (in units given by xyunits).
ysize -
6.5 | height of plot (in units given by xyunits).
xyunits -
"i" | page measurement units (can be cm ('c'), inch
('i'), meter ('m'), or point ('p')).
xshift -
0 | offset plot in horizontal (units given by xyunits)
yshift -
xsize/4 | offset plot in vertical (units given byxyunits)
proj -
'cyl' | map projection (valid choices 'linear','loglinear',
'loglog','cyl' - cylindrical equidistant, 'npst' - North Polar
Stereographic, 'spst' - South Polar Stereographic, 'lc' - Lambert
Conformal Conic, 'la' - Lambert Azimuthal, 'merc'- Mercator,
'ortho' - Orthographic, 'gst' - general stereographic).
template -
None | Previously defined class instance to use as a template.
If a class instance is provided as a template, the other keyword
arguments to __init__ are ignored.
latmin -
-90 | minimum latitude (or y axis value).
latmax -
90 | maximum latitude (or y axis value).
lonmin -
0 | miniumum longitude (or x axis value).
lonmax -
360 | maximum longitude (or x axis value). Hint - to plot
longitudes between 60 degrees west and 60 degrees east, use
lonmin=300 and lonmax=420.
rectbounds -
False | if true latmin,lonmin is interpreted as lower left
corner of rectangular map, latmax,lonmax upper right.
longrdinc -
getcint(latmin,latmax,6) | grid increment for longitude axis.
Default is to choose approx. 6 "nice" levels. If <
0, no grid lines drawn for longitude axis.
latgrdinc -
getcint(latmin,latmax,6) | grid increment for latitude axis.
Default is to choose approx. 6 "nice" levels. If <
0, no grid lines drawn for latitude axis.
lonframeinc -
3 (if proj in ['loglinear','loglog']), longrdinc otherwise |
Increment for ticks on longitude axis. For log axes, default
value of 3 means ticks will be drawn for 1,2,3,4...,9.
latframeinc -
3 (if proj in ['loglinear','loglog']), latgrdinc otherwise |
Increment for ticks on latitude axis. For log axes, default value
of 3 means ticks will be drawn for 1,2,3,4...,9.
lonlabelinc -
2 (if proj in ['loglinear','loglog']), longrdinc otherwise |
Increment for longitude axis labels. For log axes, default value
of 2 means labels will be drawn for 1,2,5.
latlabelinc -
2 (if proj in ['loglinear','loglog']), latgrdinc otherwise |
Increment for latitude axis labels. For log axes, default value
of 2 means labels will be drawn for 1,2,5.
centerlon -
0 only used if proj = "ortho" or rectbounds: True,
set to 0.5*(lonmin+lonmax) otherwise | longitude of projection
center.
centerlat -
0 only used if proj in ['ortho','la','merc','gst'] or
rectbounds: True, set to 0.5*(latmin+latmax) otherwise | latitude
of projection center.
reverseyaxis -
False | reverse direction of y-axis for non-geographic map
projections so that values decrease upwards (useful when depth or
pressure is y-axis).
verbose -
False | if true, print all GMT commands.
standardpar1 -
lonmin + (1/6)*(lonmax-lonmin) | 1st standard parallel (only
relevant if proj = 'lc').
standardpar2 -
lonmin + (5/6)*(lonmax-lonmin) | 2nd standard parallel (only
relevant if proj = 'lc').
basemaptype -
plain | basemap type ('plain' or 'fancy').
|