def output_ec2_vols(vols_datapoints=None, instance_id=None, output_type=None):
    """
    @type vols_datapoints: list
    @type instance_id: unicode
    @type output_type: unicode
    """
    try:
        import matplotlib.pyplot as plt
        import matplotlib.dates as mdates
    except ImportError:
        exit('matplotlib required to output graphs.')
    try:
        import numpy as np
    except ImportError:
        exit('install numpy.')
    if output_type in ('graph', None):
        num_plots = len(vols_datapoints)
        f, axarr = plt.subplots(num_plots, sharex=True, sharey=True)
        f.suptitle('Volumes for instance: {0}'.format(instance_id), fontsize=16
            )
        plt.ylabel('Bytes')
        if isinstance(axarr, np.ndarray):
            for index, vol_set in enumerate(vols_datapoints):
                read_dates = vol_set.get('read_dates')
                read_values = vol_set.get('read_values')
                write_dates = vol_set.get('write_dates')
                write_values = vol_set.get('write_values')
                axarr[index].set_title(vol_set.get('device_name'))
                axarr[index].grid(True)
                axarr[index].plot(write_dates, write_values, label='write')
                axarr[index].plot(read_dates, read_values, label='read')
                axarr[index].legend(loc='upper right', title=None, fancybox
                    =False)
            plt.subplots_adjust(bottom=0.2)
            plt.xticks(rotation=25)
            plt.xlabel('Time (UTC)')
        else:
            read_dates = vols_datapoints[0].get('read_dates')
            read_values = vols_datapoints[0].get('read_values')
            write_dates = vols_datapoints[0].get('write_dates')
            write_values = vols_datapoints[0].get('write_values')
            axarr.set_title(vols_datapoints[0].get('device_name'))
            axarr.plot(write_dates, write_values, label='write')
            axarr.plot(read_dates, read_values, label='read')
            axarr.legend(loc='upper right', title=None, fancybox=False)
            axarr.grid(True)
            plt.subplots_adjust(bottom=0.2)
            plt.xticks(rotation=25)
            plt.xlabel('Time (UTC)')
        ax = plt.gca()
        ax.set_ylim(bottom=0)
        handles, labels = ax.get_legend_handles_labels()
        ax.legend(handles, labels)
        xfmt = mdates.DateFormatter('%Y-%m-%d %H:%M:%S')
        ax.xaxis.set_major_formatter(xfmt)
        plt.grid(True)
        plt.show()
        exit(0)
