Ignore:
Timestamp:
Aug 26, 2008, 9:18:42 AM (15 years ago)
Author:
duncan
Message:

moving Honwood files around

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/Hinwood_2008/plot.py

    r5670 r5681  
    156156                                     y_location_tag=':0.0',
    157157                                     add_run_info=False):
     158    """
     159    Used by validation graphs to produce the final figures
     160    """
    158161    plot_type = ".pdf"
    159162    save_as_list = []
     
    180183        #save_as = pro_instance.plots_dir + sep + \
    181184        #          outputdir_name + "_" + quantity + "_" + plot_type
    182         save_as = pro_instance.plots_dir + sep + id + quantity + \
    183                   '_compare' + plot_type
     185        save_as = pro_instance.plots_dir + sep + 'S' + id[1:2] + \
     186                  '-' + quantity + '-compare' + plot_type
    184187        save_as_list.append(save_as)
    185188
     
    210213                                y_axis=None,
    211214                                y_location_tag=':0.0'):
    212     """
     215    """
     216    Used by validation graphs to produce the final figures
    213217    """
    214218    from pylab import ion, plot, xlabel, ylabel, close, legend, \
    215219         savefig, title, axis, setp, subplot, grid, figlegend, gca, \
    216          text
     220         text, sqrt
     221    import pylab
    217222   
    218223    from anuga.shallow_water.data_manager import csv2dict
    219224   
    220225    print "file_sim", file_sim
     226
     227    if False:
     228        fig_width_pt = 246.0  # Get this from LaTeX using \showthe\columnwidth
     229        inches_per_pt = 1.0/72.27               # Convert pt to inch
     230        golden_mean = (sqrt(5)-1.0)/2.0         # Aesthetic ratio
     231        fig_width = fig_width_pt*inches_per_pt  # width in inches
     232        fig_height = fig_width*golden_mean      # height in inches
     233        fig_size =  [fig_width,fig_height]
     234        print "fig_size", fig_size
     235        params = {'backend': 'ps',
     236                  'axes.labelsize': 10,
     237                  'text.fontsize': 10,
     238                  'legend.fontsize': 10,
     239                  'xtick.labelsize': 8,
     240                  'ytick.labelsize': 8,
     241                  'text.usetex': True,
     242                  'figure.figsize': [3.4, 2.1]}
     243    if False:
     244        params = {'backend': 'ps',
     245                  'axes.labelsize': 10,
     246                  'text.fontsize': 10,
     247                  'legend.fontsize': 10,
     248                  'xtick.labelsize': 8,
     249                  'ytick.labelsize': 8,
     250                  'figure.figsize': [3.4, 3.1]}
     251        pylab.rcParams.update(params)
     252
     253
     254   
    221255    # Load in the csv files and convert info from strings to floats
    222256    simulation, _ = csv2dict(file_sim)
     
    231265    for position, i in enumerate(gauge_indexs):
    232266        gauge_x = run_data['gauge_x'][i]
    233         grid_position = (len(gauge_indexs)+1)*100 + 10 + position +1
     267       
     268        grid_position = (len(gauge_indexs))*100 + 10 + position +1
    234269        subplot(grid_position)
    235270        location_sim = str(gauge_x) + y_location_tag
     
    241276   
    242277        l_sim, l_exp = plot(time_sim, quantity_sim, time_exp, quantity_exp)
    243         setp(l_sim, color='r', linestyle='--')
    244         setp(l_exp, color='b')
     278        setp(l_sim, color='k', linestyle='--')
     279        setp(l_exp, color='k')
    245280        grid(True)
    246281       
     
    282317    # The order defines the label
    283318    #legend((legend_exp, legend_sim),'upper left')
    284     figlegend((l_sim, l_exp),
    285               (legend_sim, legend_exp),
    286               'lower center')
     319
     320    # I couldn't get this working
     321    #figlegend((l_sim, l_exp),
     322     #         (legend_sim, legend_exp),
     323      #        'lower center', axespad = -0.05)
    287324   
    288325    if is_interactive:
Note: See TracChangeset for help on using the changeset viewer.