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.Frame Class Reference

Public Member Functions

def __init__
 
def __repr__
 
def SVG
 

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.

887  def __init__(self, xmin, xmax, ymin, ymax, *d, **kwds):
888  """Acts like Fig, but draws a coordinate frame around the data. You also need to supply plot ranges.
889 
890  Frame(xmin, xmax, ymin, ymax, obj, obj, obj..., keyword options...)
891 
892  xmin, xmax required minimum and maximum x values (in the objs' coordinates)
893  ymin, ymax required minimum and maximum y values (in the objs' coordinates)
894  obj optional list drawing primatives
895  keyword options keyword list options defined below
896 
897  The following are keyword options, with their default values:
898 
899  x, y 20, 5 upper-left corner of the Frame in SVG coordinates
900  width, height 75, 80 width and height of the Frame in SVG coordinates
901  flipx, flipy False, True flip the sign of the coordinate axis
902  minusInfinity -1000 if an axis is logarithmic and an object is plotted at 0 or
903  a negative value, -1000 will be used as a stand-in for NaN
904  xtitle None if a string, label the x axis
905  xticks -10 request ticks according to the standard tick specification
906  (see help(Ticks))
907  xminiticks True request miniticks according to the standard minitick
908  specification
909  xlabels True request tick labels according to the standard tick label
910  specification
911  xlogbase None if a number, the axis and transformation are logarithmic
912  with ticks at the given base (10 being the most common)
913  (same for y)
914  text_attr {} a dictionary of attributes for label text
915  axis_attr {} a dictionary of attributes for the axis lines
916  """
918  self.xmin, self.xmax, self.ymin, self.ymax = xmin, xmax, ymin, ymax
919  self.d = list(d)
920  defaults = {"x":20, "y":5, "width":75, "height":80, "flipx":False, "flipy":True, "minusInfinity":-1000, \
921  "xtitle":None, "xticks":-10, "xminiticks":True, "xlabels":True, "x2labels":None, "xlogbase":None, \
922  "ytitle":None, "yticks":-10, "yminiticks":True, "ylabels":True, "y2labels":None, "ylogbase":None, \
923  "text_attr":{}, "axis_attr":{}}
924  defaults.update(kwds)
925  kwds = defaults
927  self.x = kwds["x"]; del kwds["x"]
928  self.y = kwds["y"]; del kwds["y"]
929  self.width = kwds["width"]; del kwds["width"]
930  self.height = kwds["height"]; del kwds["height"]
931  self.flipx = kwds["flipx"]; del kwds["flipx"]
932  self.flipy = kwds["flipy"]; del kwds["flipy"]
933  self.minusInfinity = kwds["minusInfinity"]; del kwds["minusInfinity"]
934  self.xtitle = kwds["xtitle"]; del kwds["xtitle"]
935  self.xticks = kwds["xticks"]; del kwds["xticks"]
936  self.xminiticks = kwds["xminiticks"]; del kwds["xminiticks"]
937  self.xlabels = kwds["xlabels"]; del kwds["xlabels"]
938  self.x2labels = kwds["x2labels"]; del kwds["x2labels"]
939  self.xlogbase = kwds["xlogbase"]; del kwds["xlogbase"]
940  self.ytitle = kwds["ytitle"]; del kwds["ytitle"]
941  self.yticks = kwds["yticks"]; del kwds["yticks"]
942  self.yminiticks = kwds["yminiticks"]; del kwds["yminiticks"]
943  self.ylabels = kwds["ylabels"]; del kwds["ylabels"]
944  self.y2labels = kwds["y2labels"]; del kwds["y2labels"]
945  self.ylogbase = kwds["ylogbase"]; del kwds["ylogbase"]
947  self.text_attr = dict(self.text_defaults)
948  self.text_attr.update(kwds["text_attr"]); del kwds["text_attr"]
950  self.axis_attr = dict(self.axis_defaults)
951  self.axis_attr.update(kwds["axis_attr"]); del kwds["axis_attr"]
952 
953  if len(kwds) != 0:
954  raise TypeError, "Frame() got unexpected keyword arguments %s" % kwds.keys()
dictionary axis_defaults
Definition: svgfig.py:874
def __init__
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.

884  def __repr__(self):
885  return "<Frame (%d items)>" % len(self.d)
def __repr__
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.

956  def SVG(self):
957  """Apply the window transformation and return an SVG object."""
959  self.last_window = window(self.xmin, self.xmax, self.ymin, self.ymax, x=self.x, y=self.y, width=self.width, height=self.height, \
960  xlogbase=self.xlogbase, ylogbase=self.ylogbase, minusInfinity=self.minusInfinity, flipx=self.flipx, flipy=self.flipy)
961 
962  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)
963  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)
964  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)
965  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)
966 
967  left.tick_start = -self.tick_length
968  left.tick_end = 0
969  left.minitick_start = -self.minitick_length
970  left.minitick_end = 0.
971  left.text_start = self.text_yaxis_offset
972 
973  right.tick_start = 0.
974  right.tick_end = self.tick_length
975  right.minitick_start = 0.
976  right.minitick_end = self.minitick_length
977  right.text_start = -self.text_yaxis_offset
978  right.text_attr["text-anchor"] = "start"
979 
980  bottom.tick_start = 0.
981  bottom.tick_end = self.tick_length
982  bottom.minitick_start = 0.
983  bottom.minitick_end = self.minitick_length
984  bottom.text_start = -self.text_xaxis_offset
985 
986  top.tick_start = -self.tick_length
987  top.tick_end = 0.
988  top.minitick_start = -self.minitick_length
989  top.minitick_end = 0.
990  top.text_start = self.text_xaxis_offset
991  top.text_attr["dominant-baseline"] = "text-after-edge"
992 
993  output = Fig(*self.d).SVG(self.last_window)
994  output.prepend(left.SVG(self.last_window))
995  output.prepend(bottom.SVG(self.last_window))
996  output.prepend(right.SVG(self.last_window))
997  output.prepend(top.SVG(self.last_window))
998 
999  if self.xtitle != None:
1000  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))
1001  if self.ytitle != None:
1002  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))
1003  return output
def window
Definition: svgfig.py:642
int text_ytitle_offset
Definition: svgfig.py:881
int text_xaxis_offset
Definition: svgfig.py:878
float minitick_length
Definition: svgfig.py:877
float tick_length
Definition: svgfig.py:876
int text_yaxis_offset
Definition: svgfig.py:879
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

Definition at line 918 of file svgfig.py.

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

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

Definition at line 929 of file svgfig.py.

Referenced by Vispa.Main.MainWindow.MainWindow._saveIni(), Vispa.Gui.VispaWidget.VispaWidget.autosize(), Vispa.Gui.VispaWidget.VispaWidget.boundingRect(), Vispa.Gui.ConnectableWidget.ConnectableWidget.centerSinglePortVertically(), Vispa.Gui.VispaWidget.VispaWidget.contentRect(), Vispa.Gui.VispaWidget.VispaWidget.defineArrowBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget.defineCircleBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget.defineRoundRectBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget.imageRectF(), Vispa.Gui.VispaWidget.VispaWidget.paint(), Vispa.Gui.VispaWidget.VispaWidget.setZoom(), svgfig.Dots.SVG(), and Vispa.Main.MainWindow.MainWindow.updateStartupScreenGeometry().

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

Definition at line 928 of file svgfig.py.

Referenced by python.rootplot.utilities.Hist.__init_TGraph(), Vispa.Main.MainWindow.MainWindow._saveIni(), Vispa.Gui.VispaWidget.VispaWidget.autosize(), python.rootplot.root2matplotlib.Hist.bar(), python.rootplot.root2matplotlib.Hist.barh(), Vispa.Gui.VispaWidget.VispaWidget.boundingRect(), Vispa.Gui.VispaWidget.VispaWidget.contentRect(), Vispa.Gui.VispaWidget.VispaWidget.defineArrowBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget.defineCircleBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget.defineRoundRectBackgroundShape(), Vispa.Gui.VispaWidget.VispaWidget.drawHeaderBackground(), Vispa.Gui.ConnectableWidget.ConnectableWidget.drawPortNames(), Vispa.Gui.VispaWidget.VispaWidget.imageRectF(), Vispa.Gui.ConnectableWidget.ConnectableWidget.positionizeMenuWidget(), Vispa.Views.PropertyView.PropertyView.resizeEvent(), Vispa.Views.PropertyView.PropertyView.sectionResized(), Vispa.Gui.VispaWidget.VispaWidget.setZoom(), svgfig.Dots.SVG(), and Vispa.Main.MainWindow.MainWindow.updateStartupScreenGeometry().

svgfig.Frame.x

Definition at line 926 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__(), python.rootplot.root2matplotlib.Hist._prepare_xaxis(), python.rootplot.root2matplotlib.Hist._prepare_yaxis(), Vispa.Gui.WidgetContainer.WidgetContainer.autosize(), Vispa.Gui.VispaWidget.VispaWidget.boundingRect(), python.rootplot.root2matplotlib.Hist2D.box(), python.rootplot.root2matplotlib.Hist2D.contour(), python.rootplot.root2matplotlib.Hist.errorbar(), python.rootplot.root2matplotlib.Hist.errorbarh(), geometryXMLparser.Alignable.pos(), Vispa.Gui.ConnectableWidget.ConnectableWidget.positionizeMenuWidget(), svgfig.Text.SVG(), svgfig.TextGlobal.SVG(), and python.rootplot.utilities.Hist.TGraph().

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

Definition at line 927 of file svgfig.py.

Referenced by python.rootplot.utilities.Hist.__getitem__(), python.rootplot.utilities.Hist.__init_TGraph(), python.rootplot.utilities.Hist.__iter__(), svgfig.Curve.Sample.__repr__(), svgfig.Text.__repr__(), svgfig.TextGlobal.__repr__(), svgfig.HLine.__repr__(), svgfig.Ellipse.__repr__(), python.rootplot.utilities.Hist.__setitem__(), Vispa.Gui.WidgetContainer.WidgetContainer.autosize(), python.rootplot.root2matplotlib.Hist.bar(), python.rootplot.root2matplotlib.Hist.barh(), Vispa.Gui.VispaWidget.VispaWidget.boundingRect(), 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(), Vispa.Gui.ConnectableWidget.ConnectableWidget.positionizeMenuWidget(), python.rootplot.utilities.Hist.scale(), svgfig.Text.SVG(), svgfig.TextGlobal.SVG(), python.rootplot.utilities.Hist.TGraph(), and python.rootplot.utilities.Hist.TH1F().

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

Definition at line 917 of file svgfig.py.

Referenced by svgfig.YAxis.__repr__(), svgfig.Axes.__repr__(), svgfig.VGrid.__repr__(), svgfig.Grid.__repr__(), and svgfig.Axes.SVG().

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.