Example #1
0
def test_line_filter_title(plot_df):
    fig, ax = plt.subplots(figsize=(8, 8))
    plot_df.filter(variable='Primary Energy|Coal').line_plot(ax=ax,
                                                             color='model',
                                                             marker='scenario',
                                                             legend=True)
    return fig
Example #2
0
def test_bar_plot_title(plot_df):
    fig, ax = plt.subplots(figsize=(8, 8))
    (plot_df.filter(variable='Primary Energy',
                    model='test_model').bar_plot(ax=ax,
                                                 bars='scenario',
                                                 title='foo'))
    return fig
Example #3
0
def test_bar_plot_stacked(plot_df):
    fig, ax = plt.subplots(figsize=(8, 8))
    (plot_df.filter(variable='Primary Energy',
                    model='test_model').bar_plot(ax=ax,
                                                 bars='scenario',
                                                 stacked=True))
    return fig
Example #4
0
def test_line_plot_1_var(plot_df):
    fig, ax = plt.subplots(figsize=(8, 8))
    (plot_df.filter(model='test_model',
                    scenario='test_scenario').line_plot(x='Primary Energy',
                                                        y='year',
                                                        ax=ax,
                                                        legend=False))
    return fig
Example #5
0
def test_pie_plot_legend(plot_df):
    fig, ax = plt.subplots(figsize=(8, 8))
    (plot_df.filter(variable='Primary Energy', model='test_model',
                    year=2010).pie_plot(ax=ax,
                                        category='scenario',
                                        labels=None,
                                        legend=True))
    return fig
Example #6
0
def test_bar_plot_rc(plot_df):
    with update_run_control(
        {'color': {
            'scenario': {
                'test_scenario': 'black'
            }
        }}):
        fig, ax = plt.subplots(figsize=(8, 8))
        (plot_df.filter(variable='Primary Energy',
                        model='test_model').bar_plot(ax=ax, bars='scenario'))
    return fig
Example #7
0
def test_stack_plot_other(plot_df):
    fig, ax = plt.subplots(figsize=(8, 8))
    with update_run_control(
        {'color': {
            'scenario': {
                'test_scenario': 'black'
            }
        }}):
        (plot_df.filter(variable='Primary Energy',
                        model='test_model').stack_plot(ax=ax,
                                                       stack='scenario',
                                                       cmap='viridis',
                                                       title='foo'))
    return fig
Example #8
0
def test_stack_plot(plot_df):
    fig, ax = plt.subplots(figsize=(8, 8))
    (plot_df.filter(variable='Primary Energy',
                    model='test_model').stack_plot(ax=ax, stack='scenario'))
    return fig