ttim.plots#

Classes#

Module Contents#

class ttim.plots.PlotTtim(ml)[source]#
_ml#
topview(win=None, ax=None, figsize=None, layers=None)[source]#

Plot top-view.

This method plots all elements (in specified layers).

Parameters:
  • win (list or tuple) – [x1, x2, y1, y2]

  • ax (matplotlib.Axes, optional) – axes to plot on, default is None which creates a new figure

  • figsize (tuple of 2 values) – size of figure

  • layers (int or list of ints, optional) – layers to plot, default is None which plots elements in all layers

Returns:

ax – axes with plot

Return type:

matplotlib.Axes

xsection(xy=None, labels=True, params=False, ax=None, fmt=None)[source]#

Plot cross-section of model.

Note: this method does not plot elements at this time. It does plot cross-section inhoms if the model is a cross-section model (ModelXsection).

Parameters:
  • xy (list of tuples, optional) – list of tuples with coordinates of the form [(x0, y0), (x1, y1)]. If not provided, a cross section with length 1 is plotted.

  • labels (bool, optional) – add layer numbering labels to plot

  • params (bool, optional) – add parameter values to plot

  • ax (matplotlib.Axes, optional) – axes to plot on, default is None which creates a new figure

  • fmt (str, optional) – format string for parameter values, e.g. ‘.2f’ for 2 decimals.

Returns:

ax – axes with plot

Return type:

matplotlib.Axes

head_along_line(x1=0, x2=1, y1=0, y2=0, npoints=100, t=1.0, layers=0, sstart=0, color=None, lw=1, figsize=None, ax=None, legend=True, grid=True)[source]#

Plot head along line.

Parameters:
  • x1 (float) – start and end coordinates of line

  • x2 (float) – start and end coordinates of line

  • y1 (float) – start and end coordinates of line

  • y2 (float) – start and end coordinates of line

  • npoints (int) – number of points along line

  • t (scalar or array) – times at which to plot heads

  • layers – layers for which to plot heads

  • sstart (float) – starting distance for cross-section

  • color (str) – color of line

  • lw (float) – line width

  • figsize (tuple of 2 values) – size of figure

  • ax (matplotlib.Axes) – axes to plot on, default is None which creates a new figure

  • legend (bool) – add legend to plot

  • grid (bool) – add grid to plot

Returns:

ax – axes with plot

Return type:

matplotlib.Axes

contour(win, ngr=20, t=1, layers=0, levels=20, layout=True, labels=True, decimals=1, color=None, ax=None, figsize=None, legend=True)[source]#

Contour plot.

Parameters:
  • win (list or tuple) – [x1, x2, y1, y2]

  • ngr (scalar, tuple or list) – if scalar: number of grid points in x and y direction if tuple or list: nx, ny, number of grid points in x and y direction

  • t (scalar) – time

  • layers (integer, list or array) – layers for which grid is returned

  • levels (integer or array (default 20)) – levels that are contoured

  • layout (boolean (default True_)) – plot layout of elements

  • labels (boolean (default True)) – print labels along contours

  • decimals (integer (default 1)) – number of decimals of labels along contours

  • color (str or list of strings) – color of contour lines

  • ax (matplotlib.Axes) – axes to plot on, default is None which creates a new figure

  • figsize (tuple of 2 values (default is mpl default)) – size of figure

  • legend (list or boolean (default True)) – add legend to figure if list of strings: use strings as names in legend

Returns:

ax – axes with plot

Return type:

matplotlib.Axes