How to write a function that passes different key word arguments to different functions
<p>I would like to write a function that passes different keyword arguments to different functions.</p>

<p>For example, I want to write a function that plots a histogram of my data by first creating axes via <code>gca</code> and then adding the histogram via <code>hist</code>. I would like the user to be able to pass additional keyword arguments to both <code>gca</code> and <code>hist</code>.</p>

<p>Something like this (syntax error in the defintion line) is what I'm looking for,</p>

<pre><code>import matplotlib.pyplot as plt 

def plot_hist(data, **kwargs_hist, **kwargs_gca):
    ax = plt.gca(**kwargs_gca)       
    fig = ax.hist(data, **kwargs_hist)[0]
    return fig
</code></pre>