Call a Gnuplot script, passing it arguments and
    datasets.

    Args:
        scipt_name(str): The name of the Gnuplot script.
        args_dict(dict): A dictionary of parameters to pass
            to the script.  The `key` is the name of the variable
            that the `item` will be passed to the Gnuplot script
            with.
        data(list): A list of lists containing lists to be plotted.
            The lists can be accessed by plotting the variable
            `data` in the Gnuplot script.  The first list in the
            list of lists corresponds to the first column in data,
            and so on.
        silent (bool): `True` if Gnuplot stdout should be silenced,
            `False` if not.

    Returns:
        str: The Gnuplot command used to call the script.

def gnuplot(script_name, args_dict={}, data=[], silent=True):
    '''
    Call a Gnuplot script, passing it arguments and
    datasets.

    Args:
        scipt_name(str): The name of the Gnuplot script.
        args_dict(dict): A dictionary of parameters to pass
            to the script.  The `key` is the name of the variable
            that the `item` will be passed to the Gnuplot script
            with.
        data(list): A list of lists containing lists to be plotted.
            The lists can be accessed by plotting the variable
            `data` in the Gnuplot script.  The first list in the
            list of lists corresponds to the first column in data,
            and so on.
        silent (bool): `True` if Gnuplot stdout should be silenced,
            `False` if not.

    Returns:
        str: The Gnuplot command used to call the script.
    '''

    gnuplot_command = 'gnuplot'

    if data:
        assert 'data' not in args_dict, \
            'Can\'t use \'data\' variable twice.'
        data_temp = _GnuplotDataTemp(*data)
        args_dict['data'] = data_temp.name

    if args_dict:
        gnuplot_command += ' -e "'
        for arg in args_dict.items():
            gnuplot_command += arg[0] + '='
            if isinstance(arg[1], str):
                gnuplot_command += '\'' + arg[1] + '\''
            elif isinstance(arg[1], bool):
                if arg[1] is True:
                    gnuplot_command += '1'
                else:
                    gnuplot_command += '0'
            elif hasattr(arg[1], '__iter__'):
                gnuplot_command += '\'' + ' '.join([str(v) for v in arg[1]]) + '\''
            else:
                gnuplot_command += str(arg[1])
            gnuplot_command += '; '
        gnuplot_command  = gnuplot_command[:-1]
        gnuplot_command += '"'

    gnuplot_command += ' ' + script_name

    if silent:
        gnuplot_command += ' > /dev/null 2>&1'

    os.system(gnuplot_command)

    return gnuplot_command