コード例 #1
0
def plot_all_envelopes(results, outcomes, grouped, save, title):
    if grouped == True:
        for kpi in list(outcomes.keys())[1:]:  # drop first entry (TIME)
            fig, axes = envelopes(results,
                                  density=u'kde',
                                  outcomes_to_show=kpi,
                                  group_by='policy',
                                  fill=True)

            if save == True:
                plt.savefig('plots/scenario_basecase/' +
                            time.strftime('%Y%m%d') + title +
                            '_lines_grouped_' + kpi + '.png',
                            dpi=1200)
            else:
                print(kpi + ' was not saved')
    else:
        for kpi in list(outcomes.keys())[1:]:  # drop first entry (TIME)
            fig, axes = envelopes(results,
                                  density=u'kde',
                                  outcomes_to_show=kpi,
                                  fill=True)

            if save == True:
                plt.savefig('plots/scenario_policies/' +
                            time.strftime('%Y%m%d') + title + '_lines_' + kpi +
                            '.png',
                            dpi=1200)
            else:
                print(kpi + ' was not saved')
コード例 #2
0
def plot_individual_policies_envelopes(experiments, outcomes, policy,
                                       outcomes_to_show):
    '''Plot individual policy experiment sets'''
    sliced_result = slice_results(experiments, outcomes, policy)

    ig, axes = envelopes(sliced_result,
                         outcomes_to_show=outcomes_to_show,
                         fill=True,
                         group_by=False,
                         density=KDE)
    print('Plot of policy: ', policy)
コード例 #3
0
'''
Created on Jul 8, 2014

@author: [email protected]
'''
import matplotlib.pyplot as plt

from ema_workbench.util import ema_logging, load_results

from ema_workbench.analysis.plotting import envelopes 
from ema_workbench.analysis.plotting_util import KDE


ema_logging.log_to_stderr(ema_logging.INFO)

file_name = r'./data/1000 flu cases.tar.gz'
results = load_results(file_name)

# the plotting functions return the figure and a dict of axes
fig, axes = envelopes(results, group_by='policy', density=KDE, fill=True)

# we can access each of the axes and make changes
for key, value in axes.iteritems():
    # the key is the name of the outcome for the normal plot
    # and the name plus '_density' for the endstate distribution
    if key.endswith('_density'):
        value.set_xscale('log')

plt.show()
コード例 #4
0
                  show_envelope=True, 
                  experiments_to_show=indices)
                      
        #n = key
        #plt.savefig("./pictures/adopter_category_bounded_no.png".format(key), dpi=75)
plt.show()


print(outcome)




#print(results)



#print(results)


# the plotting functions return the figure and a dict of axes
fig, axes = envelopes(results, group_by='policy', density=KDE, fill=True)

# we can access each of the axes and make changes
for key, value in axes.iteritems():
    # the key is the name of the outcome for the normal plot
    # and the name plus '_density' for the endstate distribution
    if key.endswith('_density'):
        value.set_xscale('log')

plt.show()
コード例 #5
0

'''
Created on Jul 8, 2014

@author: [email protected]
'''
import matplotlib.pyplot as plt

from ema_workbench import ema_logging, load_results

from ema_workbench.analysis.plotting import envelopes
from ema_workbench.analysis.plotting_util import KDE

ema_logging.log_to_stderr(ema_logging.INFO)

file_name = r'./data/1000 flu cases with policies.tar.gz'
experiments, outcomes = load_results(file_name)

# the plotting functions return the figure and a dict of axes
fig, axes = envelopes(experiments, outcomes, group_by='policy',
                      density=KDE, fill=True)

# we can access each of the axes and make changes
for key, value in axes.items():
    # the key is the name of the outcome for the normal plot
    # and the name plus '_density' for the endstate distribution
    if key.endswith('_density'):
        value.set_xscale('log')

plt.show()