def number_freq_plots(runs, map_label):
    """Calculate the number of plots needed for allfreq plots and frequency
    histogram plots

    """
    num_cpu_plots = len(map_label)
    has_devfreq_data = False
    for run in runs:
        if len(run.devfreq_in_power.data_frame) > 0:
            has_devfreq_data = True
            break
    num_freq_plots = num_cpu_plots
    if has_devfreq_data:
        num_freq_plots += 1
    return num_freq_plots
