TotalDepth.util.plot.XGrid (X Axis Gird Line Module)

Provides plotting support for the X axis grid i.e. Depth grid lines and text.

Created on 28 Feb 2011

TODO: Remove APIs that are not used by Plot or anything. Plot only appears to use genXAxisRange() and genXAxisTextRange().

exception TotalDepth.util.plot.XGrid.ExceptionPlotXGrid

Exception for plotting.

TotalDepth.util.plot.XGrid.StrokeGreySolid = Stroke(width='1', colour='grey', coding=None, opacity=1.0)

Definition of a grey solid stroke Usage: StrokeBlackGrey._replace(width=2.0)

class TotalDepth.util.plot.XGrid.XGrid(scale)

Class that can generate depth line grid and alphanumeric values. Constructed with integer scale.

DEFAULT_INTERVAL_MAP = {1: Stroke(width=0.5, colour='black', coding=None, opacity=1.0), 10: Stroke(width=1.0, colour='black', coding=None, opacity=1.0)}

Default for unknown units and scale, this is basically like simple graph paper

DEFAULT_INTERVAL_TEXT = 100

Default position for text on the X axis

__init__(scale)

Constructor with integer scale. We make scale a constructor argument as we know that up front. We don’t necessarily know the X units.

genXAxisRange(evFrom, evTo)

Generates a bounded series of X axis line plot positions as (Dim(), Stroke()). evFrom and evTo and EngVal objects.

genXPosStroke(xFrom, xInc, units)

Generates unbounded series of X line positions as (Dim(), Stroke()).

xFrom - The starting value as a float, positions may not include this if fractional. First x position generated will be math.ceil() if xInc, math.floor() otherwise.

xInc - A boolean, True if X increases.

units - Units of X axis e.g. b’FEET’.

genEventsUnits(xFrom, xInc, units)

Generates events from/to in units.

genXAxisTextRange(evFrom, evTo)

Generates a bounded series of X axis line plot positions as (Dim(), value). evFrom and evTo and EngVal objects.

__weakref__

list of weak references to the object (if defined)