# Path: graphics_utils.py
# def initialize_graphics():
#     rcParams.update({'figure.autolayout': True})
#     rc('text', usetex=True)
#     # Configure palette and plotting to pgf/tikz
#     sns.set(style="nogrid")
#     return sns.color_palette("colorblind")    
# 
# def cm2inch(tupl):
#     """Helper function to convert centimeters to inches.
#     """
#     return tuple(i/2.54 for i in tupl)


import matplotlib.pyplot as plt
import numpy as np
from matplotlib.patches import Ellipse
from numpy.random import rand
from graphics_utils import initialize_graphics, cm2inch


r = rand(40)/5
t = rand(40)
x = r * np.cos(2*np.pi*t) - 0.3
y = r * np.sin(2*np.pi*t) - 0.3

r = rand(40)/5
t = rand(40)
xx = r * np.cos(2*np.pi*t) + 0.3
yy = r/3 * np.sin(2*np.pi*t) + 0.3


r = rand(40)/5
t = rand(40)
xxx = r/2 * np.cos(2*np.pi*t) - 0.15
yyy = r * np.sin(2*np.pi*t) + 0.15

colors = initialize_graphics()
circle1 = Ellipse((-0.3, -0.3), 0.42, 0.42, facecolor='none', edgecolor=colors[1], linewidth=4, label='Decision boundary')
circle2 = Ellipse((0.3, 0.3), 0.42, 0.22, facecolor='none', edgecolor=colors[1], linewidth=4)
circle3 = Ellipse((-0.15, +0.15), 0.22, 0.42, facecolor='none', edgecolor=colors[1], linewidth=4)

fig, ax = plt.subplots()
fig.set_size_inches(cm2inch([10,10]))
plt.plot(x, y, 'o', color=colors[0], label='Unlabeled instances')
plt.plot(xx, yy, 'o', color=colors[0])

# Path: graphics_utils.py
# def initialize_graphics():
#     rcParams.update({'figure.autolayout': True})
#     rc('text', usetex=True)
#     # Configure palette and plotting to pgf/tikz
#     sns.set(style="nogrid")
#     return sns.color_palette("colorblind")    
# 
# def cm2inch(tupl):
#     """Helper function to convert centimeters to inches.
#     """
#     return tuple(i/2.54 for i in tupl)


# Path: unsupervised.py
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.patches import Ellipse
from numpy.random import rand
from graphics_utils import initialize_graphics, cm2inch



r = rand(40)/5
t = rand(40)
x = r * np.cos(2*np.pi*t) - 0.3
y = r * np.sin(2*np.pi*t) - 0.3

r = rand(40)/5
t = rand(40)
xx = r * np.cos(2*np.pi*t) + 0.3
yy = r/3 * np.sin(2*np.pi*t) + 0.3


r = rand(40)/5
t = rand(40)
xxx = r/2 * np.cos(2*np.pi*t) - 0.15
yyy = r * np.sin(2*np.pi*t) + 0.15

colors = initialize_graphics()
circle1 = Ellipse((-0.3, -0.3), 0.42, 0.42, facecolor='none', edgecolor=colors[1], linewidth=4, label='Decision boundary')
circle2 = Ellipse((0.3, 0.3), 0.42, 0.22, facecolor='none', edgecolor=colors[1], linewidth=4)
circle3 = Ellipse((-0.15, +0.15), 0.22, 0.42, facecolor='none', edgecolor=colors[1], linewidth=4)

fig, ax = plt.subplots()
fig.set_size_inches(cm2inch([10,10]))
plt.plot(x, y, 'o', color=colors[0], label='Unlabeled instances')
plt.plot(xx, yy, 'o', color=colors[0])

plt.plot(xxx, yyy, 'o', color=colors[0])