CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Static Public Attributes
svgfig.Text Class Reference

Public Member Functions

def __init__
 
def __repr__
 
def SVG
 

Public Attributes

 attr
 
 d
 
 x
 
 y
 

Static Public Attributes

dictionary defaults = {"stroke":"none", "fill":"black", "font-size":5}
 

Detailed Description

Draws at text string at a specified point in local coordinates.

x, y                   required      location of the point in local coordinates
d                      required      text/Unicode string
attribute=value pairs  keyword list  SVG attributes 

Definition at line 1835 of file svgfig.py.

Constructor & Destructor Documentation

def svgfig.Text.__init__ (   self,
  x,
  y,
  d,
  attr 
)

Definition at line 1848 of file svgfig.py.

1849  def __init__(self, x, y, d, **attr):
1850  self.x = x
1851  self.y = y
1852  self.d = str(d)
1853  self.attr = dict(self.defaults)
1854  self.attr.update(attr)
def __init__
Definition: svgfig.py:1848
dictionary defaults
Definition: svgfig.py:1843
#define str(s)

Member Function Documentation

def svgfig.Text.__repr__ (   self)

Definition at line 1845 of file svgfig.py.

References svgfig.SVG.attr, svgfig.Path.attr, svgfig.Curve.attr, svgfig.Poly.attr, svgfig.Text.attr, svgfig.Fig.d, svgfig.Plot.d, svgfig.Frame.d, svgfig.Path.d, svgfig.Poly.d, svgfig.Text.d, MuonGeometryArrange::MGACollection.x, svgfig.Plot.x, svgfig.Frame.x, svgfig.Text.x, MuonGeometryArrange::MGACollection.y, svgfig.Plot.y, svgfig.Frame.y, svgfig.Curve.Sample.y, and svgfig.Text.y.

Referenced by data_sources.json_file.__str__().

1846  def __repr__(self):
1847  return "<Text %s at (%g, %g) %s>" % (repr(self.d), self.x, self.y, self.attr)
def __repr__
Definition: svgfig.py:1845
def svgfig.Text.SVG (   self,
  trans = None 
)
Apply the transformation "trans" and return an SVG object.

Definition at line 1855 of file svgfig.py.

References svgfig.SVG.attr, svgfig.Path.attr, svgfig.Curve.attr, svgfig.Poly.attr, svgfig.Text.attr, svgfig.Fig.d, svgfig.Plot.d, svgfig.Frame.d, svgfig.Path.d, svgfig.Poly.d, svgfig.Text.d, svgfig.totrans(), MuonGeometryArrange::MGACollection.x, svgfig.Plot.x, svgfig.Frame.x, svgfig.Text.x, MuonGeometryArrange::MGACollection.y, svgfig.Plot.y, svgfig.Frame.y, svgfig.Curve.Sample.y, and svgfig.Text.y.

1856  def SVG(self, trans=None):
1857  """Apply the transformation "trans" and return an SVG object."""
1858  if isinstance(trans, str): trans = totrans(trans)
1859 
1860  X, Y = self.x, self.y
1861  if trans != None: X, Y = trans(X, Y)
1862  return SVG("text", self.d, x=X, y=Y, **self.attr)
def totrans
Definition: svgfig.py:598

Member Data Documentation

svgfig.Text.attr

Definition at line 1852 of file svgfig.py.

Referenced by svgfig.Text.__repr__(), svgfig.TextGlobal.__repr__(), svgfig.Dots.__repr__(), svgfig.LineGlobal.__repr__(), svgfig.Ticks.__repr__(), svgfig.Axes.__repr__(), svgfig.HGrid.__repr__(), svgfig.VGrid.__repr__(), svgfig.Grid.__repr__(), svgfig.Text.SVG(), svgfig.TextGlobal.SVG(), svgfig.LineGlobal.SVG(), svgfig.Axes.SVG(), svgfig.XErrorBars.SVG(), and svgfig.YErrorBars.SVG().

svgfig.Text.d

Definition at line 1851 of file svgfig.py.

Referenced by svgfig.Text.__repr__(), svgfig.TextGlobal.__repr__(), svgfig.Dots.__repr__(), svgfig.XErrorBars.__repr__(), svgfig.YErrorBars.__repr__(), svgfig.Text.SVG(), svgfig.TextGlobal.SVG(), svgfig.Dots.SVG(), svgfig.XErrorBars.SVG(), and svgfig.YErrorBars.SVG().

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

Definition at line 1843 of file svgfig.py.

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

svgfig.Text.x

Definition at line 1849 of file svgfig.py.

Referenced by python.rootplot.utilities.Hist.__init_TGraph(), svgfig.Curve.Sample.__repr__(), svgfig.Text.__repr__(), svgfig.TextGlobal.__repr__(), svgfig.VLine.__repr__(), svgfig.Ellipse.__repr__(), edmStreamStallGrapher.Point.__str__(), python.rootplot.root2matplotlib.Hist._prepare_xaxis(), python.rootplot.root2matplotlib.Hist._prepare_yaxis(), python.rootplot.root2matplotlib.Hist2D.box(), python.rootplot.root2matplotlib.Hist2D.contour(), python.rootplot.root2matplotlib.Hist.errorbar(), python.rootplot.root2matplotlib.Hist.errorbarh(), geometryXMLparser.Alignable.pos(), ntupleDataFormat._HitObject.r(), ntupleDataFormat._HitObject.r3D(), svgfig.Text.SVG(), svgfig.TextGlobal.SVG(), and python.rootplot.utilities.Hist.TGraph().

svgfig.Text.y

Definition at line 1850 of file svgfig.py.

Referenced by python.rootplot.utilities.Hist.__getitem__(), python.rootplot.utilities.Hist.__init_TGraph(), python.rootplot.utilities.Hist.__iter__(), svgfig.Text.__repr__(), svgfig.TextGlobal.__repr__(), svgfig.HLine.__repr__(), svgfig.Ellipse.__repr__(), python.rootplot.utilities.Hist.__setitem__(), edmStreamStallGrapher.Point.__str__(), python.rootplot.root2matplotlib.Hist.bar(), python.rootplot.root2matplotlib.Hist.barh(), python.rootplot.root2matplotlib.Hist2D.box(), python.rootplot.root2matplotlib.Hist2D.contour(), python.rootplot.utilities.Hist.divide_wilson(), python.rootplot.root2matplotlib.Hist.errorbar(), python.rootplot.root2matplotlib.Hist.errorbarh(), python.rootplot.root2matplotlib.Hist.hist(), python.rootplot.utilities.Hist.min(), geometryXMLparser.Alignable.pos(), ntupleDataFormat._HitObject.r(), ntupleDataFormat._HitObject.r3D(), python.rootplot.utilities.Hist.scale(), svgfig.Text.SVG(), svgfig.TextGlobal.SVG(), python.rootplot.utilities.Hist.TGraph(), and python.rootplot.utilities.Hist.TH1F().