Written by Yair Mau. Check out my webpage for more tutorials: http://www.yairmau.com/
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
fig=plt.figure(1, (5, 5))
fig.subplots_adjust(left=0.0, right=1.0, top=1.0, bottom=0.0,
hspace=0, wspace=0)
ax = plt.Axes(fig, [0., 0., 1., 1.])
fig.add_axes(ax)
ax.set_axis_off()
x0 = 0.3
x=np.linspace(x0, 1, 1001)
y = lambda x: (1.0 - x0)**(-2) * x**2 - (1.0 - x0)**(-2)*2*x0*x + (1.0 - x0)**(-2)*x0**2
c1 = '#6c7053' # bottom right
c2 = '#6e0014' # top left
ax.fill_between(y(x), x, y2=0, facecolor=c1,
edgecolor='None') # bottom right
ax.fill_between(y(x), x, y2=1, facecolor=c2,
edgecolor=c2) # top left
ax.text(0.1, 0.8, c2, color="white", fontsize=20)
ax.text(0.4, 0.2, c1, color="white", fontsize=20)
fig.savefig("./figures/site-logo.png", resolution=600, transparent=True)
fig.savefig("./figures/site-logo.svg")
plt.show()