|
13 | 13 | def plot_mass_balance(chid, title_text): |
14 | 14 |
|
15 | 15 | plot_style = fdsplotlib.get_plot_style('fds') |
16 | | - ddir = '../../Verification/Species/' |
17 | | - pltdir = '../../Manuals/FDS_Verification_Guide/SCRIPT_FIGURES/' |
| 16 | + fds_dir = os.path.normpath(os.path.join(os.path.dirname(__file__),'..','..','..')) |
| 17 | + ddir = os.path.join(fds_dir, 'Verification','Species','') |
| 18 | + pltdir = os.path.join(fds_dir, 'Manuals','FDS_Verification_Guide','SCRIPT_FIGURES','') |
18 | 19 |
|
19 | 20 | mass_file = os.path.join(ddir, f'{chid}_mass.csv') |
20 | 21 |
|
@@ -47,16 +48,15 @@ def plot_mass_balance(chid, title_text): |
47 | 48 |
|
48 | 49 | # Plot zero reference line first (black solid line, no label) |
49 | 50 | fig = fdsplotlib.plot_to_fig(x_data=t, y_data=np.zeros_like(t), marker_style='k-',revision_label=version_string,legend_location='upper right', |
50 | | - x_label='time (s)', y_label='mass flow (kg/s)',x_min=0, x_max=2000, y_min=-0.005, y_max=0.015) |
| 51 | + x_label='time (s)', y_label='mass flow (kg/s)',x_min=0, x_max=2000, y_min=-0.005, y_max=0.015, |
| 52 | + xnumticks=6, ynumticks=5) |
51 | 53 | fdsplotlib.plot_to_fig(x_data=t, y_data=mdot_in, figure_handle=fig, marker_style='r-', data_label='Inlet H2O') |
52 | 54 | fdsplotlib.plot_to_fig(x_data=t, y_data=-mdot_out, figure_handle=fig, marker_style='m-', data_label='Outlet H2O') |
53 | 55 | fdsplotlib.plot_to_fig(x_data=t, y_data=bal, figure_handle=fig, marker_style='b-', data_label='dm/dt+out-in') |
54 | 56 |
|
55 | 57 | ax = plt.gca() |
56 | 58 | lines = ax.get_lines() |
57 | | - lines[2].set_color('#EDB120') # Orange for outlet (second data line) |
58 | | - ax.locator_params(axis='x', nbins=6) # ~6 ticks on x-axis |
59 | | - ax.locator_params(axis='y', nbins=5) # ~5 ticks on y-axis |
| 59 | + lines[2].set_color('orange') # Orange for outlet (second data line) |
60 | 60 | fdsplotlib.apply_global_exponent(ax, axis='y') |
61 | 61 | ax.text(100, 18e-3, title_text,fontsize=plot_style['Title_Font_Size'],fontname=plot_style['Font_Name']) |
62 | 62 |
|
|
0 commit comments