Ignore:
Timestamp:
09/02/10 11:36:23 (11 years ago)
Author:
pnorton
Message:

First attempt at extending the make figure code to include metadata and legends.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cowsclient/trunk/cowsclient/lib/build_figure.py

    r5821 r6517  
    1111from cowsclient.lib.base import request 
    1212from cowsclient.lib.png_combine import merge 
     13 
     14from cowsclient.lib.figure_builder import FigureBuilder 
    1315 
    1416from cStringIO import StringIO 
     
    4850     
    4951    if mplAvailable: 
    50         finalImg = addAxisToImage(defaults, params) 
     52        finalImg, points = addAxisToImage(defaults, params) 
     53         
     54        fb = FigureBuilder(params) 
     55        finalImg  = fb.buildImage(finalImg, points) 
     56     
    5157    else: 
    5258        finalImg = buildImage(defaults, params) 
     
    131137    # create an empty image with the axes drawn 
    132138    fig = Figure(figsize=figsize, dpi=dpi, facecolor=facecolor, frameon=(not transparent)) 
    133     axes = fig.add_axes([0.1, 0.1, 0.8, 0.8],  frameon=True) 
     139    axes = fig.add_axes([0.05, 0.05, 0.9, 0.9],  frameon=True) 
    134140 
    135141    log.debug("axes.get_position() = %s" % (axes.get_position(),)) 
     
    169175    log.debug("defaults['HEIGHT'] = %s" % (defaults['HEIGHT'],)) 
    170176 
     177 
     178     
    171179    #request the new GetMap images 
    172180    img = buildImage(defaults, params) 
     181     
     182    log.debug("im.size = %s, img.size = %s, box = %s" % (im.size, img.size, box,)) 
    173183 
    174184    #paste them inside the axis 
     
    176186 
    177187     
    178     return im 
     188    return im, box 
    179189 
Note: See TracChangeset for help on using the changeset viewer.