I needed to generate some correlated variables to test some correlation coefficients, similar to the data sets in this Wikipedia article. I modified the code found in the instructions on the use of the MINE library in Python.

%matplotlib inline
import matplotlib.pyplot as plt
def mySubPlot(plotData,
              numRows,
              numCols,
              plotNum,
              xlim=(-4, 4),
              ylim=(-4, 4)):

    ax = plt.subplot(numRows, numCols, plotNum, xlim=xlim, ylim=ylim)
    ax.set_title(plotData['name'],fontsize=8)
    ax.set_frame_on(False)
    ax.axes.get_xaxis().set_visible(False)
    ax.axes.get_yaxis().set_visible(False)
    ax.plot(plotData['data'][:, 0], plotData['data'][:, 1], ',')
    ax.set_xticks([])
    ax.set_yticks([])
    return ax

plotLims = {'Polynomial \nwith uniform noise': [(-1, 1), (-1/3, 1+1/3)],
            'Uniform rotated pi/8' :[(-np.sqrt(2+np.sqrt(2)) / np.sqrt(2), np.sqrt(2+np.sqrt(2)) / np.sqrt(2)), (-np.sqrt(2+np.sqrt(2)) / np.sqrt(2), np.sqrt(2+np.sqrt(2)) / np.sqrt(2))],
            'Uniform rotated 2*pi/8' : [(-np.sqrt(2), np.sqrt(2)), (-np.sqrt(2), np.sqrt(2))],
            'Square \nwith uniform noise':[(-1, 1), (-1, 3)],
            'Square with noise \nrandomly reflected in x':[(-1.5, 1.5), (-1.5, 1.5)],
            'Sin x \ncos x with noise':[(-1.5, 1.5), (-1.5, 1.5)],
            'Mixture of 4 normals': [(-7, 7), (-7, 7)]
           }


plt.figure(facecolor='white', figsize=(12, 9))
for i, data in enumerate(makeMvNormal(n=800)):
    mySubPlot(data, 3, 7, i + 1)

for i, data in enumerate(makeRotNormal(n=200)):
    mySubPlot(data, 3, 7, i + 8)

for i, data in enumerate(makeOtherDist(n=800)):
    mySubPlot(data, 3, 7, i + 15, plotLims[data['name']][0], plotLims[data['name']][1])

plt.tight_layout()
plt.show()

png