CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Static Public Attributes
svgfig.Frame Class Reference

Public Member Functions

def __init__ (self, xmin, xmax, ymin, ymax, d, kwds)
 
def __repr__ (self)
 
def SVG (self)
 

Public Attributes

 axis_attr
 
 d
 
 flipx
 
 flipy
 
 height
 
 last_window
 
 minusInfinity
 
 text_attr
 
 width
 
 x
 
 x2labels
 
 xlabels
 
 xlogbase
 
 xminiticks
 
 xticks
 
 xtitle
 
 y
 
 y2labels
 
 ylabels
 
 ylogbase
 
 ymax
 
 yminiticks
 
 yticks
 
 ytitle
 

Static Public Attributes

dictionary axis_defaults = {}
 
float minitick_length = 0.75
 
dictionary text_defaults = {"stroke":"none", "fill":"black", "font-size":5}
 
int text_xaxis_offset = 1
 
int text_xtitle_offset = 6
 
int text_yaxis_offset = 2
 
int text_ytitle_offset = 12
 
float tick_length = 1.5
 

Detailed Description

Definition at line 872 of file svgfig.py.

Constructor & Destructor Documentation

def svgfig.Frame.__init__ (   self,
  xmin,
  xmax,
  ymin,
  ymax,
  d,
  kwds 
)
Acts like Fig, but draws a coordinate frame around the data. You also need to supply plot ranges.

Frame(xmin, xmax, ymin, ymax, obj, obj, obj..., keyword options...)

xmin, xmax      required        minimum and maximum x values (in the objs' coordinates)
ymin, ymax      required        minimum and maximum y values (in the objs' coordinates)
obj             optional list   drawing primatives
keyword options keyword list    options defined below

The following are keyword options, with their default values:

x, y            20, 5         upper-left corner of the Frame in SVG coordinates
width, height   75, 80        width and height of the Frame in SVG coordinates
flipx, flipy    False, True   flip the sign of the coordinate axis
minusInfinity   -1000         if an axis is logarithmic and an object is plotted at 0 or
                          a negative value, -1000 will be used as a stand-in for NaN
xtitle          None          if a string, label the x axis
xticks          -10           request ticks according to the standard tick specification
                          (see help(Ticks))
xminiticks      True          request miniticks according to the standard minitick
                          specification
xlabels         True          request tick labels according to the standard tick label
                          specification
xlogbase        None          if a number, the axis and transformation are logarithmic
                          with ticks at the given base (10 being the most common)
(same for y)
text_attr       {}            a dictionary of attributes for label text
axis_attr       {}            a dictionary of attributes for the axis lines

Definition at line 886 of file svgfig.py.

886  def __init__(self, xmin, xmax, ymin, ymax, *d, **kwds):
887  """Acts like Fig, but draws a coordinate frame around the data. You also need to supply plot ranges.
888 
889  Frame(xmin, xmax, ymin, ymax, obj, obj, obj..., keyword options...)
890 
891  xmin, xmax required minimum and maximum x values (in the objs' coordinates)
892  ymin, ymax required minimum and maximum y values (in the objs' coordinates)
893  obj optional list drawing primatives
894  keyword options keyword list options defined below
895 
896  The following are keyword options, with their default values:
897 
898  x, y 20, 5 upper-left corner of the Frame in SVG coordinates
899  width, height 75, 80 width and height of the Frame in SVG coordinates
900  flipx, flipy False, True flip the sign of the coordinate axis
901  minusInfinity -1000 if an axis is logarithmic and an object is plotted at 0 or
902  a negative value, -1000 will be used as a stand-in for NaN
903  xtitle None if a string, label the x axis
904  xticks -10 request ticks according to the standard tick specification
905  (see help(Ticks))
906  xminiticks True request miniticks according to the standard minitick
907  specification
908  xlabels True request tick labels according to the standard tick label
909  specification
910  xlogbase None if a number, the axis and transformation are logarithmic
911  with ticks at the given base (10 being the most common)
912  (same for y)
913  text_attr {} a dictionary of attributes for label text
914  axis_attr {} a dictionary of attributes for the axis lines
915  """
916 
917  self.xmin, self.xmax, self.ymin, self.ymax = xmin, xmax, ymin, ymax
918  self.d = list(d)
919  defaults = {"x":20, "y":5, "width":75, "height":80, "flipx":False, "flipy":True, "minusInfinity":-1000, \
920  "xtitle":None, "xticks":-10, "xminiticks":True, "xlabels":True, "x2labels":None, "xlogbase":None, \
921  "ytitle":None, "yticks":-10, "yminiticks":True, "ylabels":True, "y2labels":None, "ylogbase":None, \
922  "text_attr":{}, "axis_attr":{}}
923  defaults.update(kwds)
924  kwds = defaults
925 
926  self.x = kwds["x"]; del kwds["x"]
927  self.y = kwds["y"]; del kwds["y"]
928  self.width = kwds["width"]; del kwds["width"]
929  self.height = kwds["height"]; del kwds["height"]
930  self.flipx = kwds["flipx"]; del kwds["flipx"]
931  self.flipy = kwds["flipy"]; del kwds["flipy"]
932  self.minusInfinity = kwds["minusInfinity"]; del kwds["minusInfinity"]
933  self.xtitle = kwds["xtitle"]; del kwds["xtitle"]
934  self.xticks = kwds["xticks"]; del kwds["xticks"]
935  self.xminiticks = kwds["xminiticks"]; del kwds["xminiticks"]
936  self.xlabels = kwds["xlabels"]; del kwds["xlabels"]
937  self.x2labels = kwds["x2labels"]; del kwds["x2labels"]
938  self.xlogbase = kwds["xlogbase"]; del kwds["xlogbase"]
939  self.ytitle = kwds["ytitle"]; del kwds["ytitle"]
940  self.yticks = kwds["yticks"]; del kwds["yticks"]
941  self.yminiticks = kwds["yminiticks"]; del kwds["yminiticks"]
942  self.ylabels = kwds["ylabels"]; del kwds["ylabels"]
943  self.y2labels = kwds["y2labels"]; del kwds["y2labels"]
944  self.ylogbase = kwds["ylogbase"]; del kwds["ylogbase"]
945 
947  self.text_attr.update(kwds["text_attr"]); del kwds["text_attr"]
948 
950  self.axis_attr.update(kwds["axis_attr"]); del kwds["axis_attr"]
951 
952  if len(kwds) != 0:
953  raise TypeError("Frame() got unexpected keyword arguments %s" % kwds.keys())
954 
dictionary axis_defaults
Definition: svgfig.py:874
def __init__(self, xmin, xmax, ymin, ymax, d, kwds)
Definition: svgfig.py:886
dictionary text_defaults
Definition: svgfig.py:873
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run

Member Function Documentation

def svgfig.Frame.__repr__ (   self)

Definition at line 883 of file svgfig.py.

References svgfig.Fig.d, svgfig.Plot.d, and svgfig.Frame.d.

Referenced by data_sources.json_file.__str__().

883  def __repr__(self):
884  return "<Frame (%d items)>" % len(self.d)
885 
def __repr__(self)
Definition: svgfig.py:883
def svgfig.Frame.SVG (   self)
Apply the window transformation and return an SVG object.

Definition at line 955 of file svgfig.py.

955  def SVG(self):
956  """Apply the window transformation and return an SVG object."""
957 
958  self.last_window = window(self.xmin, self.xmax, self.ymin, self.ymax, x=self.x, y=self.y, width=self.width, height=self.height, \
959  xlogbase=self.xlogbase, ylogbase=self.ylogbase, minusInfinity=self.minusInfinity, flipx=self.flipx, flipy=self.flipy)
960 
961  left = YAxis(self.ymin, self.ymax, self.xmin, self.yticks, self.yminiticks, self.ylabels, self.ylogbase, None, None, None, self.text_attr, **self.axis_attr)
962  right = YAxis(self.ymin, self.ymax, self.xmax, self.yticks, self.yminiticks, self.y2labels, self.ylogbase, None, None, None, self.text_attr, **self.axis_attr)
963  bottom = XAxis(self.xmin, self.xmax, self.ymin, self.xticks, self.xminiticks, self.xlabels, self.xlogbase, None, None, None, self.text_attr, **self.axis_attr)
964  top = XAxis(self.xmin, self.xmax, self.ymax, self.xticks, self.xminiticks, self.x2labels, self.xlogbase, None, None, None, self.text_attr, **self.axis_attr)
965 
966  left.tick_start = -self.tick_length
967  left.tick_end = 0
968  left.minitick_start = -self.minitick_length
969  left.minitick_end = 0.
970  left.text_start = self.text_yaxis_offset
971 
972  right.tick_start = 0.
973  right.tick_end = self.tick_length
974  right.minitick_start = 0.
975  right.minitick_end = self.minitick_length
976  right.text_start = -self.text_yaxis_offset
977  right.text_attr["text-anchor"] = "start"
978 
979  bottom.tick_start = 0.
980  bottom.tick_end = self.tick_length
981  bottom.minitick_start = 0.
982  bottom.minitick_end = self.minitick_length
983  bottom.text_start = -self.text_xaxis_offset
984 
985  top.tick_start = -self.tick_length
986  top.tick_end = 0.
987  top.minitick_start = -self.minitick_length
988  top.minitick_end = 0.
989  top.text_start = self.text_xaxis_offset
990  top.text_attr["dominant-baseline"] = "text-after-edge"
991 
992  output = Fig(*self.d).SVG(self.last_window)
993  output.prepend(left.SVG(self.last_window))
994  output.prepend(bottom.SVG(self.last_window))
995  output.prepend(right.SVG(self.last_window))
996  output.prepend(top.SVG(self.last_window))
997 
998  if self.xtitle != None:
999  output.append(SVG("text", self.xtitle, transform="translate(%g, %g)" % ((self.x + self.width/2.), (self.y + self.height + self.text_xtitle_offset)), dominant_baseline="text-before-edge", **self.text_attr))
1000  if self.ytitle != None:
1001  output.append(SVG("text", self.ytitle, transform="translate(%g, %g) rotate(-90)" % ((self.x - self.text_ytitle_offset), (self.y + self.height/2.)), **self.text_attr))
1002  return output
1003 
int text_ytitle_offset
Definition: svgfig.py:881
int text_xaxis_offset
Definition: svgfig.py:878
float minitick_length
Definition: svgfig.py:877
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
Definition: svgfig.py:642
float tick_length
Definition: svgfig.py:876
int text_yaxis_offset
Definition: svgfig.py:879
def SVG(self)
Definition: svgfig.py:955
int text_xtitle_offset
Definition: svgfig.py:880

Member Data Documentation

svgfig.Frame.axis_attr

Definition at line 949 of file svgfig.py.

dictionary svgfig.Frame.axis_defaults = {}
static

Definition at line 874 of file svgfig.py.

svgfig.Frame.d
svgfig.Frame.flipx

Definition at line 930 of file svgfig.py.

svgfig.Frame.flipy

Definition at line 931 of file svgfig.py.

svgfig.Frame.height
svgfig.Frame.last_window

Definition at line 958 of file svgfig.py.

float svgfig.Frame.minitick_length = 0.75
static

Definition at line 877 of file svgfig.py.

svgfig.Frame.minusInfinity

Definition at line 932 of file svgfig.py.

svgfig.Frame.text_attr

Definition at line 946 of file svgfig.py.

Referenced by svgfig.Axes.SVG().

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

Definition at line 873 of file svgfig.py.

Referenced by svgfig.CurveAxis.__init__().

int svgfig.Frame.text_xaxis_offset = 1
static

Definition at line 878 of file svgfig.py.

int svgfig.Frame.text_xtitle_offset = 6
static

Definition at line 880 of file svgfig.py.

int svgfig.Frame.text_yaxis_offset = 2
static

Definition at line 879 of file svgfig.py.

int svgfig.Frame.text_ytitle_offset = 12
static

Definition at line 881 of file svgfig.py.

float svgfig.Frame.tick_length = 1.5
static

Definition at line 876 of file svgfig.py.

svgfig.Frame.width
svgfig.Frame.x
svgfig.Frame.x2labels

Definition at line 937 of file svgfig.py.

svgfig.Frame.xlabels

Definition at line 936 of file svgfig.py.

Referenced by svgfig.Axes.SVG().

svgfig.Frame.xlogbase

Definition at line 938 of file svgfig.py.

Referenced by svgfig.Axes.SVG().

svgfig.Frame.xminiticks

Definition at line 935 of file svgfig.py.

Referenced by svgfig.Axes.SVG().

svgfig.Frame.xticks

Definition at line 934 of file svgfig.py.

Referenced by svgfig.Axes.SVG().

svgfig.Frame.xtitle

Definition at line 933 of file svgfig.py.

svgfig.Frame.y
svgfig.Frame.y2labels

Definition at line 943 of file svgfig.py.

svgfig.Frame.ylabels

Definition at line 942 of file svgfig.py.

Referenced by svgfig.Axes.SVG().

svgfig.Frame.ylogbase

Definition at line 944 of file svgfig.py.

Referenced by svgfig.Axes.SVG().

svgfig.Frame.ymax
svgfig.Frame.yminiticks

Definition at line 941 of file svgfig.py.

Referenced by svgfig.Axes.SVG().

svgfig.Frame.yticks

Definition at line 940 of file svgfig.py.

Referenced by svgfig.Axes.SVG().

svgfig.Frame.ytitle

Definition at line 939 of file svgfig.py.