Exemplo n.º 1
0
def grid( data ):
  fig = Figure( ( 2.56, 2.56 ), 300 )
  canvas = FigureCanvas(fig)
  d = data.time[ 0 ]
  day = glucose.glucose_for_day( data, d )
  days = glucose.get_days( data.time )
  name = str( d )

  ax = fig.add_axes((.5,0,1,1))
  xmin, xmax = days[ 0 ], days[ -1 ]
  ax.set_xlim( [ xmin, xmax ] )
  ax.grid(True)
  safe_span(ax)
  one = ax.text( .50, .50, name,
           horizontalalignment='center',
           verticalalignment='center',
           transform = ax.transAxes )
  one.remove( )
  log.info( pformat( one ) )
  ax.text( .60, .60, name + "two",
           horizontalalignment='center',
           verticalalignment='center',
           transform = ax.transAxes )
  set_daily_locators( ax )
  config_yaxis( ax )

  return canvas
Exemplo n.º 2
0
def exp( data ):
  fig = Figure( ( 2.56, 2.56 ), 300 )
  canvas = FigureCanvas(fig)
  d = data.time[ 0 ]
  day = glucose.glucose_for_day( data, d )
  name = str( d )
  ax = fig.add_axes((0,0,1,1))
  ax.text( .50, .50, name,
           horizontalalignment='center',
           verticalalignment='center',
           transform = ax.transAxes )
  ax.grid(True)
  return canvas
Exemplo n.º 3
0
def day_ticks( ):
  pass


if __name__ == '__main__':
  print "Generate a chart of a timeseries."

  parser = get_opt_parser( )
  options, args = parser.parse_args( sys.argv )
  infile, outfile = args[ 1 ], args[ 2 ]
  if infile == '-':
    infile = sys.stdin

  outfile = os.path.join(options.prefix, outfile)
  log.info( 'input: %s'  % infile )
  log.info( 'saving: %s' % outfile )
  data = get_series( infile )

  days= glucose.get_days( data.time )
  for day in days:
    records = glucose.glucose_for_day( data, day )
    n = day.strftime( '%Y-%m-%d' )
    
  canvas = y_axis_panel( )
  #canvas.print_png(outfile, transparent=True)
  #canvas.print_figure( outfile, transparent=True )
  canvas.figure.savefig( outfile, transparent=True)

#####
# EOF