Changeset 5681 for anuga_work/development/Hinwood_2008/plot.py
- Timestamp:
- Aug 26, 2008, 9:18:42 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/Hinwood_2008/plot.py
r5670 r5681 156 156 y_location_tag=':0.0', 157 157 add_run_info=False): 158 """ 159 Used by validation graphs to produce the final figures 160 """ 158 161 plot_type = ".pdf" 159 162 save_as_list = [] … … 180 183 #save_as = pro_instance.plots_dir + sep + \ 181 184 # outputdir_name + "_" + quantity + "_" + plot_type 182 save_as = pro_instance.plots_dir + sep + id + quantity+ \183 ' _compare' + plot_type185 save_as = pro_instance.plots_dir + sep + 'S' + id[1:2] + \ 186 '-' + quantity + '-compare' + plot_type 184 187 save_as_list.append(save_as) 185 188 … … 210 213 y_axis=None, 211 214 y_location_tag=':0.0'): 212 """ 215 """ 216 Used by validation graphs to produce the final figures 213 217 """ 214 218 from pylab import ion, plot, xlabel, ylabel, close, legend, \ 215 219 savefig, title, axis, setp, subplot, grid, figlegend, gca, \ 216 text 220 text, sqrt 221 import pylab 217 222 218 223 from anuga.shallow_water.data_manager import csv2dict 219 224 220 225 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 221 255 # Load in the csv files and convert info from strings to floats 222 256 simulation, _ = csv2dict(file_sim) … … 231 265 for position, i in enumerate(gauge_indexs): 232 266 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 234 269 subplot(grid_position) 235 270 location_sim = str(gauge_x) + y_location_tag … … 241 276 242 277 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') 245 280 grid(True) 246 281 … … 282 317 # The order defines the label 283 318 #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) 287 324 288 325 if is_interactive:
Note: See TracChangeset
for help on using the changeset viewer.