@staticmethod  
    def contour_plot_density(distribution, Xs=None, Ys=None, log_domain=False):
        if isinstance(distribution, Gaussian) and log_domain == False:
            gca().add_artist(Visualise.get_gaussian_ellipse_artist(distribution))
            gca().plot(distribution.mu[0], distribution.mu[1], 'r*', \
                     markersize=3.0, markeredgewidth=.1)
            return
        
        assert(distribution.dimension == 2)

        if Xs is None:
            (xmin, xmax), _ = distribution.get_plotting_bounds()
            Xs = linspace(xmin, xmax)
           
        if Ys is None:
            _, (ymin, ymax) = distribution.get_plotting_bounds()
            Ys = linspace(ymin, ymax) 
        
        D = zeros((len(Ys), len(Xs)))
        
        # compute log-density
        for i in range(len(Xs)):
            for j in range(len(Ys)):
                x = array([[Xs[i], Ys[j]]])
                D[j, i] = distribution.log_pdf(x)
        
        if log_domain == False:
            D = exp(D)
        
        contour(Xs, Ys, D, origin='lower')
Contour-plots a 2D density. If Gaussian, plots 1.96 interval contour only
dataset/ETHPy150Open karlnapf/kameleon-mcmc/kameleon_mcmc/tools/Visualise.py/Visualise.contour_plot_density