Sebastian Raschka
last updated: 05/11/2014



Happy Mother's Day!

In [1]:
import numpy as np
In [2]:
x = np.arange(-1,1.001,0.001)
In [4]:
y1 = (x**2)**(1.0/3) + np.sqrt(1-x**2)
y2 = (x**2)**(1.0/3) - np.sqrt(1-x**2)
In [5]:
%matplotlib inline
In [6]:
import matplotlib.pyplot as plt

plt.rcParams.update({'font.size': 12})
fig = plt.figure(figsize=(8,8))
plt.plot(x, y1, lw=15, color='r')
plt.plot(x, y2, lw=15, color='r')
plt.xlim(-1.2, 1.2)
plt.title("Happy Mother's Day")

ftext = 'x = np.arange(-1,1.001,0.001)'\
        '\ny1 = (x**2)**(1.0/3) + np.sqrt(1-x**2) '\
        '\ny2 = (x**2)**(1.0/3) - np.sqrt(1-x**2)'\
        '\n\n\n[inspired by a MATLAB impl. by TU Delft]'
plt.figtext(.32,.45, ftext, fontsize=11, ha='left')

plt.show()

[Source: Equation was adopted from a MATLAB implementation by researches from Delft University of Technology]