xtgeoviz.plot.xsection module

Module for fast XSection plots of wells/surfaces etc, using matplotlib.

class xtgeoviz.plot.xsection.XSection(zmin=0, zmax=9999, well=None, surfaces=None, sampling=20, nextend=5, colormap=None, zonelogshift=0, surfacenames=None, cube=None, grid=None, gridproperty=None, outline=None)[source]

Bases: BasePlot

Class for plotting a cross-section of a well.

Parameters:
  • zmin (Optional[float]) – Upper level of the plot (top Y axis).

  • zmax (float) – Lower level of the plot (bottom Y axis).

  • well (Optional[Well]) – XTGeo well object.

  • surfaces (Optional[list]) – List of XTGeo RegularSurface objects

  • surfacenames (Optional[list]) – List of surface names (str) for legend

  • cube (Optional[Cube]) – A XTGeo Cube instance

  • grid (Optional[Grid]) – A XTGeo Grid instance

  • gridproperty (Optional[GridProperty]) – A XTGeo GridProperty instance

  • colormap (Union[str, LinearSegmentedColormap, ListedColormap, None]) – Name of colormap, e.g. ‘Set1’. Default is ‘xtgeo’

  • outline (Optional[Polygons]) – XTGeo Polygons object

Init method.

property pagesize

Returns page size.

property legendsize

Returns or set the legend size.

property has_legend

Returns or set the legends.

property has_axes

Returns or set the axes status.

property colormap_facies

Set or get the facies colormap.

property colormap_zonelog

Set or get the zonelog colormap.

property colormap_perf

Set or get the perforations colormap.

property colormap_facies_dict

Set or get the facies colormap actual dict table.

property colormap_perf_dict

Set or get the perf colormap actual dict table.

property colormap_zonelog_dict

Set or get the zonelog colormap actual dict table.

property fence

Set or get the fence spesification.

canvas(title=None, subtitle=None, infotext=None, figscaling=1.0)[source]

Prepare the canvas to plot on, with title and subtitle.

Parameters:
  • title (str, optional) – Title of plot.

  • subtitle (str, optional) – Sub title of plot.

  • infotext (str, optional) – Text to be written as info string.

  • figscaling (str, optional) – Figure scaling, default is 1.0

plot_well(zonelogname='ZONELOG', facieslogname=None, perflogname=None, wellcrossings=None, wellcrossingnames=True, wellcrossingyears=False, welltrajcolor='black', welltrajwidth=6)[source]

Input an XTGeo Well object and plot it.

set_xaxis_md(gridlines=False)[source]

Set x-axis labels to measured depth.

plot_cube(colormap='seismic', vmin=None, vmax=None, alpha=0.7, interpolation='gaussian', sampling='nearest')[source]

Plot a cube backdrop.

Parameters:
  • colormap (ColorMap) – Name of color map (default ‘seismic’)

  • vmin (float) – Minimum value in plot.

  • vmax (float) –

  • alpha (float) – Alpah blending number beween 0 and 1.

  • interpolation (str) – Interpolation for plotting, cf. matplotlib documentation on this. Also gaussianN is allowed, where N = 1..9.

  • sampling (str) – ‘nearest’ (default) or ‘trilinear’ (more precise)

Raises:

ValueError – No cube is loaded

plot_grid3d(colormap='rainbow', vmin=None, vmax=None, alpha=0.7, zinc=0.5, interpolation='auto')[source]

Plot a sampled grid with gridproperty backdrop.

Parameters:
  • colormap (ColorMap) – Name of color map (default ‘rainbow’)

  • vmin (float) – Minimum value in plot.

  • vmax (float) –

  • alpha (float) – Alpha blending number beween 0 and 1.

  • zinc (float) – Sampling vertically, default is 0.5

  • interpolation (str) – Interpolation for plotting, cf. matplotlib documentation on this. “auto” uses “nearest” for discrete parameters and “antialiased” for floats.

Raises:

ValueError – No grid or gridproperty is loaded

plot_surfaces(fill=False, surfaces=None, surfacenames=None, colormap=None, onecolor=None, linewidth=1.0, linestyle='-', legend=True, legendtitle=None, fancyline=False, axisname='main', gridlines=False)[source]

Input a surface list (ordered from top to base) , and plot them.

plot_md_data(data=None, markersize=10, color='red', linestyle='', label=False, zorder=350, **kwargs)[source]

Plot MD vs TVD data as lines and/or markers.

The input pandas dataframe points shall have the following columns: * Name of well(s) named WELL * Coordinate X named MDEPTH * Coordinate Y named Z_TVDSS

plot_wellmap(otherwells=None, expand=1)[source]

Plot well map as local view, optionally with nearby wells.

Parameters:
  • otherwells (list of Polygons) – List of surrounding wells to plot, these wells are repr as Polygons instances, one per well.

  • expand (float) – Plot axis expand factor (default is 1); larger values may be used if other wells are plotted.

plot_map()[source]

Plot well location map as an overall view (with field outline).