Picturing ellipse plot $(x,y) = \left(\cos(\theta+\frac{d}{2}),\cos(\theta-\frac{d}{2})\right)$ The following paragraph taken from: A Graphical Display of Large Correlation Matrices

I am trying to produce a plot with the provided equation above for the ellipse.
For example, given I have random and normally distributed data points:
data = np.array(np.random.normal(0, 1, 500)).reshape(100, 5)
outliers = np.array(np.random.uniform(5, 10, 25)).reshape(5, 5)
data = np.vstack((data, outliers))

I can get $\theta$:
theta = np.concatenate((np.linspace(-2*np.pi, 2*np.pi, 50), np.linspace(2*np.pi, -2*np.pi, 50)))

How do I get $d$ from the equation above? I have tried:
d = np.corrcoef(data[:,0], data[:,1])
np.array((np.cos(theta+d/2), np.sin(theta-d/2)))

However, $d$ is a $2x2$ matrix in this instance.

In R you can build these plots using the corrplot function from the homonymous package. Here is an example.
install.packages("corrplot")
library(corrplot)

corrplot(cor(mtcars), method = "ellipse", order="AOE")


The order of the variables in the plot is different from that in the dataset mtcars thanks to the option order="AOE", which helps to have a nicer-looking plot.
The corrplot has a lot of options, so you might want to have a look at them,  e.g. ?corrplot, to find those most suited to your needs.
Update
To draw a single ellipse "by hand", suppose $\rho=0.5$, then you can do as follows (the plot is also shown)
theta <- seq(0,2*pi, len=1000)
rho = 0.5
d = acos(rho)
x = cos(theta + d/2)
y = cos(theta - d/2)

plot(x,y, type="l", lwd=2)


