Exemplo n.º 1
0
    sim_params['radiusPlasma'] = rp
    sim_params['radiusRBC'] = rp - sleeve_thickness
    sim_params['radiusWall'] = rp + wall_thickness
    print sim_params['radiusPlasma'], sim_params['radiusRBC'], sim_params['radiusWall']
    analytical_ivr_radius_plasma[i] = intravascularResistanceAnalytical(sim_params)

fig, ax = plt.subplots(1)
ax.plot(1e6*radius_rbc_fit_values, 1e-6*ivr_fitted_on_radius_rbc, 'k.-')
ax.plot(1e6*radius_rbc_fit_values, 1e-6*analytical_ivr_radius_rbc, 'k--')

# plt.gca().set_xlim([min(1e6*radius_rbc_fit_values), max(1e6*radius_rbc_fit_values)])
plt.plot([2.0, 2.0], [0, 10], color='k', linestyle='dotted')
# ax.text(2.03, 4.1, '$r_p = 2.0 \, \muup m$')
ax.set_xlim([min(1e6*radius_rbc_fit_values), 2.5])
ax.set_xticks([1.5, 1.7, 1.9, 2.1, 2.3, 2.5])
labels.setXLabel('r_c', 'um')
labels.setYLabel('K_{IV,0.5}', 'IVR')

axtop = ax.twiny()
plt.plot(1e6*radius_plasma_fit_values, 1e-6*ivr_fitted_on_radius_plasma, '.-', color=plasma_color)
plt.plot(1e6*radius_plasma_fit_values, 1e-6*analytical_ivr_radius_plasma, '--', color=plasma_color)

axtop.set_xlim([min(1e6*radius_plasma_fit_values), max(1e6*radius_plasma_fit_values)])
axtop.set_ylim([2, 7])
labels.setXLabel('r_p', 'um')
axtop.xaxis.label.set_color(plasma_color)
for t1 in axtop.get_xticklabels():
    t1.set_color(plasma_color)

fig_options.saveFig('plotIVR')
Exemplo n.º 2
0
results_uniform = MultiCaseResults(
    [TissueVolumeResults(case_path) for case_path in case_paths_uniform_inlet],
    np.hstack)
results_random = MultiCaseResults(
    [TissueVolumeResults(case_path) for case_path in case_paths_random_inlet],
    np.hstack)
plotter = TissueVolumeCombinedPlotter([results_random, results_uniform])

plt.clf()
plotter.plot_histogram_tissue_radii_multipanel(
    functional_colors=[
        style_scheme['int_func_radii_random_inlet_face_color'],
        style_scheme['int_func_radii_face_color']
    ],
    functional_labels=['functional (random)', 'functional (constant)'])
fig_options.saveFig('plotCombinedHistogramTissueRadii')

topol_radii = 1e6 * np.array(results_uniform.topological_tissue_radii())
func_uniform_radii = 1e6 * np.array(results_uniform.functional_tissue_radii())
func_random_radii = 1e6 * np.array(results_random.functional_tissue_radii())
print
print '{:<30s} {:7.5g} +/- {:.5g} um'.format('Topological radii:',
                                             np.mean(topol_radii),
                                             np.std(topol_radii))
print '{:<30s} {:7.5g} +/- {:.5g} um'.format('Functional radii (constant):',
                                             np.mean(func_uniform_radii),
                                             np.std(func_uniform_radii))
print '{:<30s} {:7.5g} +/- {:.5g} um'.format('Functional radii (random):',
                                             np.mean(func_random_radii),
                                             np.std(func_random_radii))
Exemplo n.º 3
0
if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('--P50',
                        '-p',
                        type=float,
                        help='PO2 at half saturation',
                        default=47.9)
    parser.add_argument('-n', type=float, help='Hill exponent', default=2.64)
    figOptions = FigureOptions(parser)
    args = parser.parse_args()
    P50 = args.P50
    nHill = args.n
    figOptions.parseOptions(args)

    P = np.linspace(0, 100, 200)
    S = np.linspace(0, 0.99, 200)
    bloodChem = BloodChemistry(nHill, P50)

    plotHillEquation(bloodChem, P)
    figOptions.saveFig('hillEquation')
    plt.clf()

    plotHillEquation(bloodChem, P, reversed=True)
    figOptions.saveFig('hillEquationReversed')
    plt.clf()

    plotdPdS(bloodChem, S)
    figOptions.saveFig('hillEquation_dPdS')
    plt.clf()
Exemplo n.º 4
0
    figOptions = FigureOptions(parser)
    args = parser.parse_args()
    case_path = args.caseName
    nAverage = args.nAverage
    nPlot = args.nPlot
    figOptions.parseOptions(args)

    postprocessor = make_post_processor(case_path)
    plotter = COSHPlotter(postprocessor)

    if args.multipanel:
        panel_layout = (2, 1) if not args.panelLayout else args.panelLayout
        fig, axs = plt.subplots(*panel_layout, sharex=True)
        plt.sca(axs[0])
        plotHbProfiles(plotter)
        annotate_axis_corner(axs[0], 'A')
        if panel_layout[1] == 1:
            axs[0].set_xlabel('')
        plt.sca(axs[1])
        plotStdHbProfiles(plotter)
        annotate_axis_corner(axs[1], 'B')
        figOptions.saveFig('plotCOSHHbProfilesMultipanel')
    else:
        plotHbProfiles(plotter)
        figOptions.saveFig('plotCOSHHbProfiles')
        plt.figure()
        plotStdHbProfiles(plotter)
        figOptions.saveFig('plotCOSHStdProfiles')
        plt.gca().set_yscale('log')
        figOptions.saveFig('plotCOSHStdProfilesLogScale')
Exemplo n.º 5
0
parser.add_argument('--paramFile',
                    help='Path to parameter study file',
                    default='params.json')
parser.add_argument('--methodName',
                    '-m',
                    help='Name of the plotting method to call')
fig_options = FigureOptions(parser)
args = parser.parse_args()
file_name = args.paramFile
method_name = args.methodName
fig_options.parseOptions(args)

fig, axs = plt.subplots(2, 2, sharey=True)
flattened_axs = [ax for sublist in axs for ax in sublist]

for study, ax, text in zip(studies, flattened_axs, annotations):
    path_to_study_file = os.path.join(path_to_parameter_studies, study,
                                      file_name)
    param_study = ParameterStudyFactory().makeParameterStudy(
        path_to_study_file)
    postprocessor = make_param_study_post_processor(param_study)
    plotter = COSHParamStudyPlotter(postprocessor, fig_options)
    plt.sca(ax)
    getattr(plotter, method_name)()
    annotate_axis_corner(ax, text)

axs[0, 1].set_ylabel('')
axs[1, 1].set_ylabel('')

fig_options.saveFig('plotCOSHMulti_{:s}'.format(method_name))
Exemplo n.º 6
0
                        default = 2.0)
    parser.add_argument('--step', type=float, help='Time difference between plots that contains all lines', \
                        default = 0.1)
    figOptions = FigureOptions(parser)
    args = parser.parse_args()
    fieldNames = args.fields
    x = args.x
    all_times = args.alltimes
    min_time  = args.min_time
    max_time  = args.max_time
    step = args.step
    figOptions.parseOptions(args)

    createPlotDirectory()

    if all_times:
        times = time_dirs('domain')
        if '0' in times:
            times.remove('0')
    else:
        n = int(round((max_time-min_time)/step) + 1)
        times = np.linspace(min_time, max_time, n)
    for time in times:
        plotRadialProfile('domain', x, float(time), fieldNames)
        figOptions.adjustAxes()
        figOptions.setGrid()
        figOptions.saveFig(plotName('domain', float(time), x))
        plt.clf()


    model_names.remove('linearized_ODE')
except ValueError:
    pass
figOptions.parseOptions(args)

parallel_capillaries = ParallelCapillaries.fromKeyValueFile('geometricData', 2)
simParams = IOHbO2ParametersStraightCapillaries('.')
postprocessor = make_post_processor('.')

plot_name_suffix = '' if simParams.cocurrentFlow() else '_countercurrent'
if model_only:
    for model_name in postprocessor.integrators:
        plotter = DiffusiveInteractionModelPlotter(
            postprocessor.integrators[model_name])
        plotter.plotAll()
        figOptions.saveFig('plot_{:s}_modelDiffusiveInteraction_Hb{:s}'.\
                           format(model_name, plot_name_suffix))
        plt.clf()
else:
    plotter = DiffusiveInteractionComparisonPlotter(postprocessor, model_names)
    if args.multipanel:
        panel_layout = (2, 1) if not args.panelLayout else args.panelLayout
        fig, axs = plt.subplots(*panel_layout, sharex=True)
        plt.sca(axs[0])
        plotter.plotHbProfiles(plot_mean=plot_mean)
        annotate_axis_corner(axs[0], 'A')
        if panel_layout[1] == 1:
            axs[0].set_xlabel('')
        plt.sca(axs[1])
        plotter.plotHbDiffProfiles(exponential_fit=exponential_fit,
                                   linearized_ode=linearized_ode)
        # legend = create_COSH_legend(axs[1], bbox_to_anchor=(1, 0.86))
Exemplo n.º 8
0
    path_to_study_file = os.path.join(path_to_parameter_studies, study,
                                      file_name)
    param_study = ParameterStudyFactory().makeParameterStudy(
        path_to_study_file)
    postprocessor = make_param_study_post_processor(param_study)
    plotter = DiffusiveInteractionParameterStudyPlotter(
        postprocessor, fig_options, model_names)
    plt.sca(ax)
    plotter.plotComparisonSaturationDifferenceDecayTime(color=color)
    ax.xaxis.label.set_color(color)
    for t1 in ax.get_xticklabels():
        t1.set_color(color)

# adapt axes limits and tick locations
ax2.set_ylim(100, 200)
ax2.yaxis.set_major_locator(MultipleLocator(20))
ax3.set_ylim(100, 200)
ax3.yaxis.set_major_locator(MultipleLocator(20))
ax2.xaxis.set_major_locator(MultipleLocator(0.2))  # RBC velocity
ax3.xaxis.set_major_locator(MultipleLocator(0.4))  # M_0

# if panel_layout[0] == 1:
#     ax3.set_ylabel('')
#     ax3.tick_params(labelleft='off')

annotate_axis_corner(ax1, 'A', xy=(0.90, 0.88))
annotate_axis_corner(ax2, 'B', xy=(0.90, 0.88))
annotate_axis_corner(ax3, 'C', xy=(0.90, 0.88))

fig_options.saveFig('plotDecayTimesDiffusiveInteractionTheoreticalAndTwinAxes')
args = parser.parse_args()
case_name = args.caseName
settings_file = args.settingsFile
error_bars = not args.noErrorBars
figOptions.parseOptions(args)

postprocessor = make_post_processor(case_name, param_file=settings_file)
plotter = HemoglobinOnWholePathsPlotter(postprocessor)

path_ids = postprocessor.selected_path_indices()

if postprocessor.selection_mode == 'nPath':
    suffix = '_n_{:d}'.format(postprocessor.n_path)
elif postprocessor.selection_mode == 'firstTime':
    suffix = '_fromTime_{:g}'.format(postprocessor.selection_first_time)
else:
    suffix = ''
average_suffix = '_hbAveraged' if postprocessor.integrator.average_hb else ''

style_scheme = StyleSchemeCOSH()
sim_linestyle = style_scheme['individualRBCWholePath']
symbol_style = style_scheme['individualRBCWholePath']
int_linestyle = {'color': '0.2', 'alpha': 1.0}

annotations = ('A', 'B', 'C', 'D')
# annotations = ('E', 'F', 'G', 'H')
plotter.plot_compared_hb_distal_distribution_multipanel(
    panel_annotation=annotations)
figOptions.saveFig('plotComparedHbDistalDistributionMultiPanel' + suffix +
                   average_suffix)
Exemplo n.º 10
0
fig, axs = plt.subplots(*panel_layout, sharey=True)
all_axs = [[ax, ax.twiny()] for ax in axs]
flattened_axs = [ax for sublist in all_axs for ax in sublist]
style_scheme = styles.StyleSchemeCOSH()
twin_axes_color = style_scheme['twinAxis']['color']
colors = ['k', twin_axes_color, 'k', twin_axes_color]

for study, ax, color in zip(studies, flattened_axs, colors):
    path_to_study_file = os.path.join(path_to_parameter_studies, study, file_name)
    param_study = ParameterStudyFactory().makeParameterStudy(path_to_study_file)
    postprocessor = make_param_study_post_processor(param_study)
    plotter = COSHParamStudyPlotter(postprocessor, fig_options)
    plt.sca(ax)
    getattr(plotter, method_name)(style={'color': color})
    ax.xaxis.label.set_color(color)
    for t1 in ax.get_xticklabels():
        t1.set_color(color)

axs[0].xaxis.set_major_locator(MultipleLocator(0.4))
axs[0].yaxis.set_major_locator(MultipleLocator(10))
flattened_axs[1].xaxis.set_major_locator(MultipleLocator(0.1))
flattened_axs[2].xaxis.set_major_locator(MultipleLocator(0.02))
flattened_axs[3].xaxis.set_major_locator(MultipleLocator(0.2))

if panel_layout[0] == 1:
    axs[1].set_ylabel('')
annotate_axis_corner(axs[0], 'A')
annotate_axis_corner(axs[1], 'B')

fig_options.saveFig('plotCOSHTwinAxes_{:s}'.format(method_name))
Exemplo n.º 11
0
"""

import argparse

import numpy as np

from HbO2.setup.simulationParameters import IOHbO2ParametersAxisymmetric
from plot.figureoptions import FigureOptions
from plot.plotHbProfileAnalytical import plotHbProfile

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    figOptions = FigureOptions(parser)
    args = parser.parse_args()
    figOptions.parseOptions(args)

    simParams = IOHbO2ParametersAxisymmetric('.')

    taperedStyle = {'style': {'color': 'k', 'linestyle': '-'}}
    straightStyle = {'style': {'color': 'b', 'linestyle': '--'}}
    plotHbProfile(simParams, **taperedStyle)

    Ra = simParams['radiusTissueLeft']
    Rv = simParams['radiusTissueRight']
    equivalentRadius = np.sqrt(1. / 3. * (Ra**2 + Ra * Rv + Rv**2))
    simParams['radiusTissueLeft'] = equivalentRadius
    simParams['radiusTissueRight'] = equivalentRadius
    plotHbProfile(simParams, **straightStyle)

    figOptions.saveFig('plotHbProfileTaperedAndStraightCylinders')
Exemplo n.º 12
0
parser.add_argument('--paramFile',
                    help='Path to parameter study file', default='params.json')
parser.add_argument('--manual-labels', action='store_true',
                    help='Whether to set manually the contour labels')
parser.add_argument('--settingsFile', help='Relative path to the file with postprocessing settings',
                    default='postprocess.json')
fig_options = FigureOptions(parser)
args = parser.parse_args()
file_name = args.paramFile
manual_labels = args.manual_labels
settings_file = args.settingsFile
fig_options.parseOptions(args)

fig, axs = plt.subplots(1, 2, sharey=True)
twin_axs = []
for study, ax, text in zip(studies, axs, annotations):
    path_to_study_file = os.path.join(path_to_parameter_studies, study, file_name)
    param_study = ParameterStudyFactory().makeParameterStudy(path_to_study_file)
    postprocessor = make_param_study_post_processor(param_study)
    plotter = PlasmaOxygenationParamStudyPlotter(postprocessor, fig_options)
    plt.sca(ax)
    plotter.contour_delta_po2(manual_labels=manual_labels)
    twin_axs.append(plt.gca())  # hack to get the twin axes
    annotate_axis_corner(ax, text, xy=(0.94, 0.92))

twin_axs[0].set_ylabel('')
twin_axs[0].set_yticklabels([])
axs[1].set_ylabel('')

fig_options.saveFig('plotPlasmaOxygenation_rc_1.5um_2.0um')
fig_options.parseOptions(args)

case_names = [os.path.join(param_study_path, case_name_profile)
              for param_study_path in parameter_studies]

panel_layout = (2, 1) if not args.panelLayout else args.panelLayout
fig, axs = plt.subplots(*panel_layout)

plt.sca(axs[0])
case_name = os.path.join(parameter_studies[1], case_name_profile)
postprocessor = make_post_processor(case_name)
plotter = DiffusiveInteractionComparisonPlotter(postprocessor, model_names)
plotter.plotHbProfiles()
add_arrows(axs[0])

plt.sca(axs[1])
styles = [{'style': {'linestyle': '-', 'color': 'k'}},
          {'style': {'linestyle': '--', 'color': 'k', 'dashes': (4, 4)}}]
for param_study_path, style in zip(parameter_studies, styles):
    param_study_file = os.path.join(param_study_path, file_name)
    param_study = ParameterStudyFactory().makeParameterStudy(param_study_file)
    settings_dict = load_settings_file(param_study_path)
    postprocessor = ParameterStudyPostProcessor(param_study, settings_dict)
    plotter = DiffusiveInteractionParameterStudyPlotter(postprocessor, fig_options, model_names)
    getattr(plotter, method_name)(**style)

annotate_axis_corner(axs[0], 'A')
annotate_axis_corner(axs[1], 'B')

fig_options.saveFig('plotDiffusiveCountercurrentComparison_{:s}'.format(method_name))
Exemplo n.º 14
0
                    help='Maximal time difference used for the linear fit')
figOptions = FigureOptions(parser)
args = parser.parse_args()
case_name = args.caseName
eids = args.edgeIndices
n_profile_min = args.nProfileMin
time_diff_max_fit = args.timeDiffMaxFit
figOptions.parseOptions(args)

postprocessor = make_post_processor(case_name)
plotter = HemoglobinOnSegmentsPlotter(postprocessor,
                                      n_profile_min=n_profile_min)

fig, axs = plt.subplots(len(eids), 2)
flattened_axs = [ax for sublist in axs for ax in sublist]
for i, (ei, annot) in enumerate(zip(eids, annotations)):
    plt.sca(axs[i, 0])
    plotter.plot_hb_profiles(ei)
    plotter.plot_hb_mean_pm_std(ei)
    plotter.restrict_x_limits_to_defined_values(ei)
    annotate_axis_corner(axs[i, 0], annot[0])

    plt.sca(axs[i, 1])
    plotter.plot_hb_drop_vs_time_to_previous_rbc(ei,
                                                 threshold=time_diff_max_fit)
    annotate_axis_corner(axs[i, 1], annot[1])

e_string = '_'.join(['{:d}'.format(ei) for ei in eids])
figOptions.saveFig(
    'plotHbProfilesWithDropVsRBCSpacing_e_{:s}'.format(e_string))
plotters = [TissueVolumePlotter(res) for res in results]
combined_results = MultiCaseResults(results, np.hstack)
combined_plotter = TissueVolumePlotter(combined_results)
styles = [dict() for _ in plotters]
labels = []
for case_path, style in zip(case_paths, styles):
    if '20151213' in case_path or 'MVN1' in case_path:
        style.update(style_scheme['MVN1'])
        style.update({'label': 'MVN 1'})
    elif '20150715' in case_path or 'MVN2' in case_path:
        style.update(style_scheme['MVN2'])
        style.update({'label': 'MVN 2'})

plt.clf()
combined_plotter.plot_histogram_tissue_radii()
fig_options.saveFig('plotHistogramTissueRadii')

plt.clf()
for plotter, style in zip(plotters, styles):
    plotter.plot_functional_vs_topological_tissue_radii(**style)
cosh_styles.create_COSH_legend(plt.gca(),
                               loc='upper left',
                               markerscale=0.7,
                               handletextpad=0,
                               handlelength=2.5)
fig_options.saveFig('plotFunctionalVsTopologicalTissueRadii')

plt.clf()
for plotter, style in zip(plotters, styles):
    plotter.plot_tissue_radii_vs_hb_mean(**style)
cosh_styles.create_COSH_legend(plt.gca(),
Exemplo n.º 16
0
    parser.add_argument('--min-time', type=float, help='Smallest time that should be used',
                        default = 0.0)
    parser.add_argument('--max-time', type=float, help='Largest time that should be used',
                        default = 2.0)
    parser.add_argument('--step', type=float, help='Time difference between plots that contains all lines', \
                        default = 0.1)
    figOptions = FigureOptions(parser)
    args = parser.parse_args()
    fieldName = args.field
    all_times = args.alltimes
    min_time  = args.min_time
    max_time  = args.max_time
    step      = args.step
    figOptions.parseOptions(args)

    createPlotDirectory()

    if all_times:
        times = time_dirs('domain')
        if '0' in times:
            times.remove('0')
    else:
        n = int(round((max_time-min_time)/step) + 1)
        times = np.linspace(min_time, max_time, n)
    for time in times:
        plotPO2ProfileEulerian('domain', float(time), fieldName)
        figOptions.adjustAxes()
        figOptions.saveFig(plotName('.', float(time)))
        plt.clf()

    plotter = AxisymmetricCasePlotter(postprocessor)
    plotter.plot_field_average_profile('Hb_mean', n_average=1)


def plotHbSimulatedGraph(caseName):
    postprocessor = GraphCasePostProcessor(caseName)
    plotter = GraphCasePlotter(postprocessor)
    plotter.plotFieldAverageProfile('Hb_mean', 0, nAverage=10)


def plotHbSimulatedAndAnalytical(caseName, simParams, **kwargs):
    if isGraphCase(caseName):
        plotHbSimulatedGraph(caseName)
    elif isAxisymmetricCase(caseName):
        plotHbSimulatedAxisymmetric(caseName)
    plotHbProfile(simParams, **kwargs)
    # plt.legend(['Simulated', 'ODE model'])


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    figOptions = FigureOptions(parser)
    args = parser.parse_args()
    figOptions.parseOptions(args)

    analyticalLineStyle = {'color': 'k', 'linestyle': '-', 'dashes': (4, 2.5)}

    simParams = SimulationParametersFactory().make_sim_params('.')
    plotHbSimulatedAndAnalytical('.', simParams, style=analyticalLineStyle)
    figOptions.saveFig('plotHbSimulatedAndAnalytical')
Exemplo n.º 18
0
from HbO2.setup.simulationParameters import IOHbO2ParametersAxisymmetric
from plot.figureoptions import FigureOptions
from plot.plotPO2ProfileAnalytical import plotPO2Profile

parser = argparse.ArgumentParser()
parser.add_argument('--cases',
                    nargs='+',
                    help='Relative paths of folders to plot',
                    default=['.'])
parser.add_argument('-r',
                    type=float,
                    help='Radius for PO2 calculation',
                    default=17.6e-6)
fig_options = FigureOptions(parser)
args = parser.parse_args()
fig_options.parseOptions(args)
cases = args.cases
radius = args.r

styles = [{'color': 'k'}, {'color': 'b'}, {'color': 'r'}]

for case, style in zip(cases, styles):
    sim_params = IOHbO2ParametersAxisymmetric(case)
    plotPO2Profile(sim_params, radius=radius, style=style)

plt.legend([case.replace('_', '-') for case in cases])

plot_name = 'plot_compare_' + '_'.join(cases) + '_r_{:g}'.format(1e6 * radius)
fig_options.saveFig(plot_name)
                    nargs='+',
                    help='Models for which to plot results',
                    default=['krogh', 'simple'])
fig_options = FigureOptions(parser)
args = parser.parse_args()
file_name = args.paramFile
method_name = args.methodName
model_names = args.modelNames
fig_options.parseOptions(args)

fig, axs = plt.subplots(2, 2, sharey=True)
flattened_axs = [ax for sublist in axs for ax in sublist]

for study, ax, text in zip(studies, flattened_axs, annotations):
    path_to_study = os.path.join(path_to_parameter_studies, study)
    path_to_study_param_file = os.path.join(path_to_study, file_name)
    param_study = ParameterStudyFactory().makeParameterStudy(
        path_to_study_param_file)
    settings_dict = load_settings_file(path_to_study)
    postprocessor = ParameterStudyPostProcessor(param_study, settings_dict)
    plotter = DiffusiveInteractionParameterStudyPlotter(
        postprocessor, fig_options, model_names)
    plt.sca(ax)
    getattr(plotter, method_name)()
    annotate_axis_corner(ax, text)

axs[0, 1].set_ylabel('')
axs[1, 1].set_ylabel('')

fig_options.saveFig('plotDiffusiveInteractionMulti_{:s}'.format(method_name))
average_suffix = '_hbAveraged' if postprocessor.integrator.average_hb else ''
integrated_suffix = '_withIntegrated' if integrated_profiles else ''

style_scheme = StyleSchemeCOSH()
sim_linestyle = style_scheme['individualRBCWholePath']
symbol_style = style_scheme['individualRBCWholePath']
int_linestyle = {'color': '0.2', 'alpha': 1.0}

if integrated_profiles:
    plotter.plot_integrated_hb_profile_vs_path_length(style=int_linestyle)
plotter.plot_distal_hb_vs_path_length_with_paths(
    path_ids,
    path_style=sim_linestyle,
    symbol_style=style_scheme['distalHbMarker'],
    error_bars=error_bars)
figOptions.saveFig('plotHbWholePathVsPathLength' + suffix + integrated_suffix)

plt.clf()
if integrated_profiles:
    plotter.plot_integrated_hb_profile_vs_transit_time(style=int_linestyle)
plotter.plot_distal_hb_vs_transit_time_with_paths(
    path_ids,
    path_style=sim_linestyle,
    symbol_style=style_scheme['distalHbMarker'],
    error_bars=error_bars)
figOptions.saveFig('plotHbWholePathVsTransitTime' + suffix + integrated_suffix)

plt.clf()
plotter.plot_hb_drop_vs_transit_time()
figOptions.saveFig('plotHbDropVsTransitTime' + suffix)
Exemplo n.º 21
0
        plotter.kroghSol.LD = LD
        plotter.kroghSol.vRBC = U
        plt.sca(ax)
        plotter.plotPO2DerivativeRatio()
        xlabel = ax.get_xlabel()
        xticklabels = ax.get_xticks().tolist()
        xticklabels = ['%i' % label for label in xticklabels]
        ax.set_xlabel('')
        ax.set_xticklabels([''])
        # ylabel      = ax.get_ylabel()
        # yticklabels = ax.get_yticks().tolist()
        # yticklabels = ['%i' % label for label in yticklabels]
        # ax.set_ylabel('')
        # ax.set_yticklabels([''])

    axs[-1].set_xlabel(xlabel)
    axs[-1].set_xticklabels(xticklabels)
    # axs[0].set_ylabel(ylabel)
    # axs[0].set_yticklabels(yticklabels)

    figOptions.adjustAxes()

    # put A, B, C at the top right corner of each plot
    axs[0].annotate(r'$\mathbf{A}$', xy=(0.90, 0.91), xycoords='axes fraction')
    axs[1].annotate(r'$\mathbf{B}$', xy=(0.90, 0.91), xycoords='axes fraction')
    axs[2].annotate(r'$\mathbf{C}$', xy=(0.90, 0.91), xycoords='axes fraction')

    plotName = 'plotMultiPO2DerivativeRatio'
    # plotName = 'plotMultiPO2DerivativeRatioHorizontal'
    figOptions.saveFig(plotName)
        style.update(style_scheme['MVN2'])

if args.multipanel:
    panel_layout = (2, 1) if not args.panelLayout else args.panelLayout
    fig, axs = plt.subplots(*panel_layout, sharex=True)
    plt.sca(axs[0])
    for plotter, style in zip(plotters, styles):
        plotter.plot_std_difference_vs_upstream_std(**style)
    if panel_layout[1] == 1:
        axs[0].set_xlabel('')
    annotate_axis_corner(axs[0], 'A')
    plt.sca(axs[1])
    for plotter, style in zip(plotters, styles):
        plotter.plot_std_slope_vs_upstream_std(**style)
    annotate_axis_corner(axs[1], 'B')
    figOptions.saveFig('plotStdDifferenceAndSlopeVsUpstreamStd')
else:
    plt.clf()
    for plotter, style in zip(plotters, styles):
        plotter.plot_std_difference_vs_upstream_std(**style)
    figOptions.saveFig('plotStdDifferenceVsUpstreamStd')

    plt.clf()
    for plotter, style in zip(plotters, styles):
        plotter.plot_std_slope_vs_upstream_std(**style)
    xlim = (-0.001, plt.gca().get_xlim()[1])
    plt.gca().set_xlim(xlim)
    figOptions.saveFig('plotStdSlopeVsUpstreamStd')

    plt.clf()
    for plotter, style in zip(plotters, styles):