Skip to content
bmaranville edited this page Jun 28, 2011 · 15 revisions

Plotting API (proposed)

1d plotting API

Proposed plan includes simultaneous y-axes (transforms of the coordinate systems)

plottable_data = {
    'x': {'linear': {'data':[1,2,3,4], 'label':'position (m)'}},
    'y': {
        'linear': {'data': [1,10,100,1000], 'label':'TbFe Intensity (cps)'},
        'log10': {'data': [0,1,2,3], 'label':'Log10 (TbFe Intensity (cps))'},
        },
    'title': 'I am the title of the graph',
    'clear_existing': False,
    'color': 'Red',
    'style': 'line',
    };

2d plotting API

The proposed data structure, to be fed over the wire to the plotting engine, is as follows: in JSON,

plottable_data = {
    'counts':  [ [1, 2], [3, 4] ],
    'title': 'This is the title',
    'xmax': 1.0,
    'xmin': 0.0, 
    'ymin': 0.0, 
    'ymax': 12.0,
    'xdim': 608,
    'ydim': 512, 
    'xlabel': 'This is my x-axis label',
    'ylabel': 'This is my y-axis label',
};

A tool for converting from the industry-standard x,y,z triplets to the row-ordered form above will be provided.

Clone this wiki locally