CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes
svgfig.CurveAxis Class Reference
Inheritance diagram for svgfig.CurveAxis:
svgfig.Curve svgfig.Ticks

Public Member Functions

def __init__ (self, f, low, high, ticks=-10, miniticks=True, labels=True, logbase=None, arrow_start=None, arrow_end=None, text_attr={}, **attr)
 
def __repr__ (self)
 
def SVG (self, trans=None)
 
- Public Member Functions inherited from svgfig.Curve
def __init__ (self, f, low, high, loop=False, **attr)
 
def Path (self, trans=None, local=False)
 
def sample (self, trans=None)
 end nested class More...
 
def subsample (self, left, right, depth, trans=None)
 
- Public Member Functions inherited from svgfig.Ticks
def compute_logminiticks (self, base)
 
def compute_logticks (self, base, N, format)
 
def compute_miniticks (self, original_ticks)
 
def compute_ticks (self, N, format)
 
def interpret (self)
 
def orient_tickmark (self, t, trans=None)
 
def regular_miniticks (self, N)
 

Static Public Attributes

dictionary defaults = {"stroke-width":"0.25pt"}
 
dictionary text_defaults = {"stroke":"none", "fill":"black", "font-size":5}
 
- Static Public Attributes inherited from svgfig.Curve
dictionary defaults = {}
 
int discontinuity_limit = 5.
 
float linearity_limit = 0.05
 
bool random_sampling = True
 
int recursion_limit = 15
 
- Static Public Attributes inherited from svgfig.Ticks
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
 

Additional Inherited Members

- Public Attributes inherited from svgfig.Curve
 attr
 
 f
 
 high
 
 last_samples
 
 loop
 
 low
 
- Public Attributes inherited from svgfig.Ticks
 arrow_end
 
 arrow_start
 
 attr
 
 f
 
 high
 
 labels
 
 last_miniticks
 
 logbase
 
 low
 
 miniticks
 
 text_attr
 
 ticks
 

Detailed Description

Draw an axis with tick marks along a parametric curve.

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

f                      required         a Python callable or string in
                                        the form "f(t), g(t)", just like Curve
low, high              required         left and right endpoints
ticks                  default=-10      request ticks according to the standard
                                        tick specification (see help(Ticks))
miniticks              default=True     request miniticks according to the
                                        standard minitick specification
labels                 True             request tick labels according to the
                                        standard tick label specification
logbase                default=None     if a number, the x axis is logarithmic
                                        with ticks at the given base (10 being
                                        the most common)
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

Definition at line 2791 of file svgfig.py.

Constructor & Destructor Documentation

◆ __init__()

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

Reimplemented from svgfig.Ticks.

Definition at line 2826 of file svgfig.py.

2826  def __init__(self, f, low, high, ticks=-10, miniticks=True, labels=True, logbase=None, arrow_start=None, arrow_end=None, text_attr={}, **attr):
2827  tattr = dict(self.text_defaults)
2828  tattr.update(text_attr)
2829  Curve.__init__(self, f, low, high)
2830  Ticks.__init__(self, f, low, high, ticks, miniticks, labels, logbase, arrow_start, arrow_end, tattr, **attr)
2831 

References svgfig.Frame.text_defaults, and svgfig.Ticks.text_defaults.

Member Function Documentation

◆ __repr__()

def svgfig.CurveAxis.__repr__ (   self)

Reimplemented from svgfig.Curve.

Definition at line 2823 of file svgfig.py.

2823  def __repr__(self):
2824  return "<CurveAxis %s [%s, %s] ticks=%s labels=%s %s>" % (self.f, self.low, self.high, str(self.ticks), str(self.labels), self.attr)
2825 

References svgfig.SVG.attr, svgfig.Path.attr, svgfig.Curve.attr, hippyaddtobaddatafiles.KeepWhileOpenFile.f, svgfig.Curve.f, svgfig.Curve.high, svgfig.Ticks.labels, svgfig.Curve.low, str, and svgfig.Ticks.ticks.

Referenced by data_sources.json_file.__str__().

◆ SVG()

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

Reimplemented from svgfig.Curve.

Definition at line 2832 of file svgfig.py.

2832  def SVG(self, trans=None):
2833  """Apply the transformation "trans" and return an SVG object."""
2834  func = Curve.SVG(self, trans)
2835  ticks = Ticks.SVG(self, trans) # returns a <g />
2836 
2837  if self.arrow_start != False and self.arrow_start != None:
2838  if isinstance(self.arrow_start, str):
2839  func.attr["marker-start"] = "url(#%s)" % self.arrow_start
2840  else:
2841  func.attr["marker-start"] = "url(#%s)" % self.arrow_start.id
2842 
2843  if self.arrow_end != False and self.arrow_end != None:
2844  if isinstance(self.arrow_end, str):
2845  func.attr["marker-end"] = "url(#%s)" % self.arrow_end
2846  else:
2847  func.attr["marker-end"] = "url(#%s)" % self.arrow_end.id
2848 
2849  ticks.append(func)
2850  return ticks
2851 

References svgfig.Line.arrow_end, svgfig.LineGlobal.arrow_end, svgfig.Ticks.arrow_end, and svgfig.Ticks.arrow_start.

Member Data Documentation

◆ defaults

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

Definition at line 2820 of file svgfig.py.

Referenced by tree.Tree.reset(), and tree.Tree.var().

◆ text_defaults

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

Definition at line 2821 of file svgfig.py.

str
#define str(s)
Definition: TestProcessor.cc:51