CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Static Public Attributes
svgfig.Ticks Class Reference
Inheritance diagram for svgfig.Ticks:
svgfig.CurveAxis svgfig.Grid svgfig.HGrid svgfig.LineAxis svgfig.VGrid svgfig.XAxis svgfig.YAxis

Public Member Functions

def __init__
 
def __repr__
 
def compute_logminiticks
 
def compute_logticks
 
def compute_miniticks
 
def compute_ticks
 
def interpret
 
def orient_tickmark
 
def regular_miniticks
 
def SVG
 

Public Attributes

 arrow_end
 
 arrow_start
 
 attr
 
 f
 
 high
 
 labels
 
 last_miniticks
 
 logbase
 
 low
 
 miniticks
 
 text_attr
 
 ticks
 

Static Public Attributes

dictionary defaults = {"stroke-width":"0.25pt"}
 
float minitick_end = 0.75
 
float minitick_start = -0.75
 
int text_angle = 0
 
dictionary text_defaults = {"stroke":"none", "fill":"black", "font-size":5}
 
float text_start = 2.5
 
float tick_end = 1.5
 
float tick_start = -1.5
 

Detailed Description

Superclass for all graphics primatives that draw ticks,
miniticks, and tick labels.  This class only draws the ticks.

Ticks(f, low, high, ticks, miniticks, labels, logbase, arrow_start,
      arrow_end, text_attr, attribute=value)

f                       required        parametric function along which ticks
                                        will be drawn; has the same format as
                                        the function used in Curve
low, high               required        range of the independent variable
ticks                   default=-10     request ticks according to the standard
                                        tick specification (see below)
miniticks               default=True    request miniticks according to the
                                        standard minitick specification (below)
labels                  True            request tick labels according to the
                                        standard tick label specification (below)
logbase                 default=None    if a number, the axis is logarithmic with
                                        ticks at the given base (usually 10)
arrow_start             default=None    if a new string identifier, draw an arrow
                                        at the low-end of the axis, referenced by
                                        that identifier; if an SVG marker object,
                                        use that marker
arrow_end               default=None    if a new string identifier, draw an arrow
                                        at the high-end of the axis, referenced by
                                        that identifier; if an SVG marker object,
                                        use that marker
text_attr               default={}      SVG attributes for the text labels
attribute=value pairs   keyword list    SVG attributes for the tick marks 

Standard tick specification:

    * True: same as -10 (below).
    * Positive number N: draw exactly N ticks, including the endpoints. To
      subdivide an axis into 10 equal-sized segments, ask for 11 ticks.
    * Negative number -N: draw at least N ticks. Ticks will be chosen with
      "natural" values, multiples of 2 or 5.
    * List of values: draw a tick mark at each value.
    * Dict of value, label pairs: draw a tick mark at each value, labeling
      it with the given string. This lets you say things like {3.14159: "pi"}.
    * False or None: no ticks.

Standard minitick specification:

    * True: draw miniticks with "natural" values, more closely spaced than
      the ticks.
    * Positive number N: draw exactly N miniticks, including the endpoints.
      To subdivide an axis into 100 equal-sized segments, ask for 101 miniticks.
    * Negative number -N: draw at least N miniticks.
    * List of values: draw a minitick mark at each value.
    * False or None: no miniticks. 

Standard tick label specification:

    * True: use the unumber function (described below)
    * Format string: standard format strings, e.g. "%5.2f" for 12.34
    * Python callable: function that converts numbers to strings
    * False or None: no labels 

Definition at line 2320 of file svgfig.py.

Constructor & Destructor Documentation

def svgfig.Ticks.__init__ (   self,
  f,
  low,
  high,
  ticks = -10,
  miniticks = True,
  labels = True,
  logbase = None,
  arrow_start = None,
  arrow_end = None,
  text_attr = {},
  attr 
)

Definition at line 2391 of file svgfig.py.

Member Function Documentation

def svgfig.Ticks.__repr__ (   self)

Definition at line 2388 of file svgfig.py.

def svgfig.Ticks.compute_logminiticks (   self,
  base 
)
Return optimal logarithmic miniticks, given a set of ticks.

Normally only used internally.

Definition at line 2769 of file svgfig.py.

def svgfig.Ticks.compute_logticks (   self,
  base,
  N,
  format 
)
Return less than -N or exactly N optimal logarithmic ticks.

Normally only used internally.

Definition at line 2718 of file svgfig.py.

def svgfig.Ticks.compute_miniticks (   self,
  original_ticks 
)
Return optimal linear miniticks, given a set of ticks.

Normally only used internally.

Definition at line 2689 of file svgfig.py.

def svgfig.Ticks.compute_ticks (   self,
  N,
  format 
)
Return less than -N or exactly N optimal linear ticks.

Normally only used internally.

Definition at line 2601 of file svgfig.py.

def svgfig.Ticks.interpret (   self)
Evaluate and return optimal ticks and miniticks according to
the standard minitick specification.

Normally only used internally.

Definition at line 2507 of file svgfig.py.

def svgfig.Ticks.orient_tickmark (   self,
  t,
  trans = None 
)
Return the position, normalized local x vector, normalized
local y vector, and angle of a tick at position t.

Normally only used internally.

Definition at line 2408 of file svgfig.py.

def svgfig.Ticks.regular_miniticks (   self,
  N 
)
Return exactly N linear ticks.

Normally only used internally.

Definition at line 2677 of file svgfig.py.

def svgfig.Ticks.SVG (   self,
  trans = None 
)
Apply the transformation "trans" and return an SVG object.

Definition at line 2435 of file svgfig.py.

Member Data Documentation

svgfig.Ticks.arrow_end

Definition at line 2400 of file svgfig.py.

svgfig.Ticks.arrow_start

Definition at line 2399 of file svgfig.py.

svgfig.Ticks.attr

Definition at line 2402 of file svgfig.py.

dictionary svgfig.Ticks.defaults = {"stroke-width":"0.25pt"}
static

Definition at line 2379 of file svgfig.py.

svgfig.Ticks.f

Definition at line 2392 of file svgfig.py.

Referenced by ztail.Decoder.initial_synchronize().

svgfig.Ticks.high

Definition at line 2394 of file svgfig.py.

svgfig.Ticks.labels

Definition at line 2397 of file svgfig.py.

svgfig.Ticks.last_miniticks

Definition at line 2439 of file svgfig.py.

svgfig.Ticks.logbase

Definition at line 2398 of file svgfig.py.

svgfig.Ticks.low

Definition at line 2393 of file svgfig.py.

float svgfig.Ticks.minitick_end = 0.75
static

Definition at line 2384 of file svgfig.py.

float svgfig.Ticks.minitick_start = -0.75
static

Definition at line 2383 of file svgfig.py.

svgfig.Ticks.miniticks

Definition at line 2396 of file svgfig.py.

int svgfig.Ticks.text_angle = 0
static

Definition at line 2386 of file svgfig.py.

svgfig.Ticks.text_attr

Definition at line 2405 of file svgfig.py.

dictionary svgfig.Ticks.text_defaults = {"stroke":"none", "fill":"black", "font-size":5}
static

Definition at line 2380 of file svgfig.py.

float svgfig.Ticks.text_start = 2.5
static

Definition at line 2385 of file svgfig.py.

float svgfig.Ticks.tick_end = 1.5
static

Definition at line 2382 of file svgfig.py.

float svgfig.Ticks.tick_start = -1.5
static

Definition at line 2381 of file svgfig.py.

svgfig.Ticks.ticks

Definition at line 2395 of file svgfig.py.