<s> import sys <EOL> import json <EOL> import numpy as np <EOL> import pylab <EOL> def plot ( X , Y , theory , data , err ) : <EOL> pylab . subplot ( <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> pylab . pcolormesh ( X , Y , data ) <EOL> pylab . subplot ( <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> pylab . pcolormesh ( X , Y , theory ) <EOL> pylab . subplot ( <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:3> ) <EOL> pylab . pcolormesh ( X , Y , ( data - theory ) / ( err + <NUM_LIT:1> ) ) <EOL> def load_results ( filename ) : <EOL> """<STR_LIT>""" <EOL> data = json . load ( open ( filename ) ) <EOL> data . update ( ( k , np . array ( data [ k ] ) ) <EOL> for k in ( '<STR_LIT:X>' , '<STR_LIT:Y>' , '<STR_LIT:data>' , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> return data <EOL> def main ( ) : <EOL> data = load_results ( sys . argv [ <NUM_LIT:1> ] ) <EOL> plot ( data [ '<STR_LIT:X>' ] , data [ '<STR_LIT:Y>' ] , data [ '<STR_LIT>' ] , data [ '<STR_LIT:data>' ] , data [ '<STR_LIT>' ] ) <EOL> pylab . show ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : main ( ) </s>
