Ejemplo n.º 1
0
 def create(self, data, positioner, graphtexrunner, errorname):
     canvas = painter.axiscanvas(self.painter, graphtexrunner)
     v = 0
     position = self.firstdist
     for name in data.names:
         subaxis = data.subaxes[name]
         subaxis.vmin = position / float(data.size)
         if subaxis.sized:
             position += subaxis.data.size
         else:
             position += 1
         subaxis.vmax = position / float(data.size)
         position += 0.5*self.dist
         subaxis.vminover = v
         if name == data.names[-1]:
             subaxis.vmaxover = 1
         else:
             subaxis.vmaxover = position / float(data.size)
         subaxis.setpositioner(subaxispositioner(positioner, subaxis))
         subaxis.create()
         canvas.insert(subaxis.canvas)
         if canvas.extent_pt < subaxis.canvas.extent_pt:
             canvas.extent_pt = subaxis.canvas.extent_pt
         position += 0.5*self.dist
         v = subaxis.vmaxover
     if self.painter is not None:
         self.painter.paint(canvas, data, self, positioner)
     return canvas
Ejemplo n.º 2
0
 def create(self, data, positioner, graphtextengine, errorname):
     canvas = painter.axiscanvas(self.painter, graphtextengine)
     v = 0
     position = self.firstdist
     for name in data.names:
         subaxis = data.subaxes[name]
         subaxis.vmin = position / float(data.size)
         if subaxis.sized:
             position += subaxis.data.size
         else:
             position += 1
         subaxis.vmax = position / float(data.size)
         position += 0.5 * self.dist
         subaxis.vminover = v
         if name == data.names[-1]:
             subaxis.vmaxover = 1
         else:
             subaxis.vmaxover = position / float(data.size)
         subaxis.setpositioner(subaxispositioner(positioner, subaxis))
         subaxis.create()
         for layer, subcanvas in list(subaxis.canvas.layers.items()):
             canvas.layer(layer).insert(subcanvas)
         assert len(subaxis.canvas.layers) == len(subaxis.canvas.items)
         if canvas.extent_pt < subaxis.canvas.extent_pt:
             canvas.extent_pt = subaxis.canvas.extent_pt
         position += 0.5 * self.dist
         v = subaxis.vmaxover
     if self.painter is not None:
         self.painter.paint(canvas, data, self, positioner)
     return canvas
Ejemplo n.º 3
0
 def layout(data):
     self.adjustaxis(data, data.ticks, graphtexrunner, errorname)
     self.texter.labels(data.ticks)
     if self.divisor:
         for t in data.ticks:
             t *= tick.rational(self.divisor)
     canvas = painter.axiscanvas(self.painter, graphtexrunner)
     if self.painter is not None:
         self.painter.paint(canvas, data, self, positioner)
     return canvas
Ejemplo n.º 4
0
 def layout(data):
     self.adjustaxis(data, data.ticks, graphtexrunner, errorname)
     self.texter.labels(data.ticks)
     if self.divisor:
         for t in data.ticks:
             t *= tick.rational(self.divisor)
     canvas = painter.axiscanvas(self.painter, graphtexrunner)
     if self.painter is not None:
         self.painter.paint(canvas, data, self, positioner)
     return canvas
Ejemplo n.º 5
0
 def layout(data):
     if data.ticks:
         self.adjustaxis(data, [convert_tick(data.ticks[0]), convert_tick(data.ticks[-1])], graphtextengine, errorname)
     self.texter.labels(data.ticks)
     if self.divisor:
         for t in data.ticks:
             t *= rational_divisor
     canvas = painter.axiscanvas(self.painter, graphtextengine)
     if self.painter is not None:
         self.painter.paint(canvas, data, self, positioner)
     return canvas
Ejemplo n.º 6
0
Archivo: axis.py Proyecto: mjg/PyX-svn
 def layout(data):
     if data.ticks:
         self.adjustaxis(data, [convert_tick(data.ticks[0]), convert_tick(data.ticks[-1])], graphtexrunner, errorname)
     self.texter.labels(data.ticks)
     if self.divisor:
         for t in data.ticks:
             t *= rational_divisor
     canvas = painter.axiscanvas(self.painter, graphtexrunner)
     if self.painter is not None:
         self.painter.paint(canvas, data, self, positioner)
     return canvas
Ejemplo n.º 7
0
 def createlinked(self, data, positioner, graphtexrunner, errorname, linkpainter):
     canvas = painter.axiscanvas(self.painter, graphtexrunner)
     for name in data.names:
         subaxis = data.subaxes[name]
         subaxis = linkedaxis(subaxis, name)
         subaxis.setpositioner(subaxispositioner(positioner, data.subaxes[name]))
         subaxis.create()
         canvas.insert(subaxis.canvas)
         if canvas.extent_pt < subaxis.canvas.extent_pt:
             canvas.extent_pt = subaxis.canvas.extent_pt
     if linkpainter is not None:
         linkpainter.paint(canvas, data, self, positioner)
     return canvas
Ejemplo n.º 8
0
 def layout(data):
     if data.ticks:
         self.adjustaxis(data, [
             float(data.ticks[0]) * divisor,
             float(data.ticks[-1]) * divisor
         ], graphtexrunner, errorname)
     self.texter.labels(data.ticks)
     if self.divisor:
         for t in data.ticks:
             t *= rational_divisor
     canvas = painter.axiscanvas(self.painter, graphtexrunner)
     if self.painter is not None:
         self.painter.paint(canvas, data, self, positioner)
     return canvas
Ejemplo n.º 9
0
 def createlinked(self, data, positioner, graphtextengine, errorname, linkpainter):
     canvas = painter.axiscanvas(self.painter, graphtextengine)
     for name in data.names:
         subaxis = data.subaxes[name]
         subaxis = linkedaxis(subaxis, name)
         subaxis.setpositioner(subaxispositioner(positioner, data.subaxes[name]))
         subaxis.create()
         for layer, subcanvas in list(subaxis.canvas.layers.items()):
             canvas.layer(layer).insert(subcanvas)
         assert len(subaxis.canvas.layers) == len(subaxis.canvas.items)
         if canvas.extent_pt < subaxis.canvas.extent_pt:
             canvas.extent_pt = subaxis.canvas.extent_pt
     if linkpainter is not None:
         linkpainter.paint(canvas, data, self, positioner)
     return canvas
Ejemplo n.º 10
0
 def createlinked(self, data, positioner, graphtexrunner, errorname,
                  linkpainter):
     canvas = painter.axiscanvas(self.painter, graphtexrunner)
     for name in data.names:
         subaxis = data.subaxes[name]
         subaxis = linkedaxis(subaxis, name)
         subaxis.setpositioner(
             subaxispositioner(positioner, data.subaxes[name]))
         subaxis.create()
         canvas.insert(subaxis.canvas)
         if canvas.extent_pt < subaxis.canvas.extent_pt:
             canvas.extent_pt = subaxis.canvas.extent_pt
     if linkpainter is not None:
         linkpainter.paint(canvas, data, self, positioner)
     return canvas
Ejemplo n.º 11
0
 def createlinked(self, data, positioner, graphtexrunner, errorname, linkpainter):
     canvas = painter.axiscanvas(self.painter, graphtexrunner)
     if linkpainter is not None:
         linkpainter.paint(canvas, data, self, positioner)
     return canvas
Ejemplo n.º 12
0
 def createlinked(self, data, positioner, graphtextengine, errorname,
                  linkpainter):
     canvas = painter.axiscanvas(self.painter, graphtextengine)
     if linkpainter is not None:
         linkpainter.paint(canvas, data, self, positioner)
     return canvas