import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
# Linear classification plot
= np.linspace(0, 2, 100)
x = 0.1 * x**2 + 2
y ='Linear Classification', color='navy', lw=3)
plt.plot(x, y, label
# Scattered points for two different classes
= np.random.randint(0, 100, 10)
random_idx = y - 0.7*np.random.rand(100)
class_1_points = y + 0.7*np.random.rand(100)
class_2_points
# Scatter circles for Class 1 (hollow)
plt.scatter(x[random_idx], class_1_points[random_idx],='black', facecolors='none', marker='o', label='Class 1', lw=2)
edgecolors
# Scatter diamonds for Class 2 (hollow)
plt.scatter(x[random_idx], class_2_points[random_idx], ='black', facecolors='none', marker='D', label='Class 2', lw=2)
edgecolors
# Adding text in black
1, 1, 'Sustainability Lab', fontsize=36, ha='center', color='black')
plt.text(1, 0.3, 'AI for Sustainability', fontsize=16, ha='center', color='black')
plt.text(
'off')
plt.axis(
plt.tight_layout()
# Create a grey background for the entire figure
= plt.subplots(figsize=(4, 5))
fig, ax '#F4F4F0') # Light grey background color
fig.patch.set_facecolor(
# Quadratic classification plot with a curved line
= np.linspace(0, 2, 100)
x = 0.1 * x**2 + 2
y ='Quadratic Classification', color='navy', linewidth=3)
ax.plot(x, y, label
# Scattered points for two different classes
42)
np.random.seed(= np.random.randint(0, 100, 10)
random_idx = y - 0.7 * np.random.rand(100)
class_1_points = y + 0.7 * np.random.rand(100)
class_2_points
# Scatter circles for Class 1 (hollow)
ax.scatter(x[random_idx], class_1_points[random_idx],='navy', facecolors='none', marker='o', label='Class 1', linewidth=2)
edgecolors
# Scatter diamonds for Class 2 (hollow)
ax.scatter(x[random_idx], class_2_points[random_idx], ='navy', facecolors='none', marker='D', label='Class 2', linewidth=2)
edgecolors
# Adding text in black with adjusted positions
1, 0.7, 'Sustainability Lab', fontsize=24, ha='center', color='navy')
ax.text(1, 0.3, 'AI for Sustainability', fontsize=14, ha='center', color='navy')
ax.text(
# Remove x and y-axis ticks and labels for a cleaner look
ax.set_xticks([])
ax.set_yticks([])
# Show the legend
#ax.legend()
# Remove top and right spines
'top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines[
# Set the face color of the plot area to grey
'#F4F4F0')
ax.set_facecolor(
# Set the width of the axes
'bottom'].set_linewidth(3)
ax.spines['left'].set_linewidth(3)
ax.spines[
plt.tight_layout()
# Draw sigmoid function to write S and write L besides it
import matplotlib.patches as patches
def sigmoid(x):
return 1 / (1 + np.exp(-x))
= np.linspace(-20, 20, 800)
x_range
='Sigmoid Function', color='navy',
plt.plot(x_range, sigmoid(x_range), label=30, alpha=0.8)
lw
# Draw "X" around x = 13, 17, 19
= np.array([13, 17, 19])
xs_plus ='white', marker='X', s=250, zorder=3)
plt.scatter(xs_plus, sigmoid(xs_plus), color
= np.array([-10, -14, -18])
xs_o ='white', marker='o', s=250, zorder=3)
plt.scatter(xs_o, sigmoid(xs_o), color
= plt.gca()
ax
ax.set_xticks([])
ax.set_yticks([])
# Show the legend
#ax.legend()
# Remove top and right spines
'top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.spines[
# Set the face color of the plot area to grey
'#F4F4F0')
ax.set_facecolor(
# Draw L-shaped figure from x = 25 onwards to match sigmoid height
# The height of the sigmoid function is between 0 and 1
= sigmoid(25)
l_height = patches.Rectangle((25, -0.05), 5, l_height + 0.05, facecolor='navy')
vertical_part = patches.Rectangle((25, -0.05), 15, 0.1, facecolor='navy')
horizontal_part
# Add the L-shape to the plot
ax.add_patch(vertical_part)
ax.add_patch(horizontal_part)
= 25
x_start = 0
y_start = 40
x_end
# add resistor symbol
= np.linspace(x_start + 1, x_end - 1, (x_end - x_start - 2)*2)
x_resistor = np.zeros_like(x_resistor)
y_resistor # odd places are +0.05 and even places are -0.05
1::2] += 0.03
y_resistor[2] -= 0.03
y_resistor[::='white', lw=2) plt.plot(x_resistor, y_resistor, color
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import FancyBboxPatch
# Sigmoid function
def sigmoid(x):
return 1 / (1 + np.exp(-x))
# Generate data
= np.linspace(-20, 20, 1200)
x_range = sigmoid(x_range)
y_range
= plt.subplots(figsize=(10, 6))
fig, ax
# Plot sigmoid function with shadow
='Sigmoid Function', color='navy', lw=10, zorder=3)
ax.plot(x_range, y_range, label- 0.03, color='grey', lw=10, alpha=0.4, zorder=2)
ax.plot(x_range, y_range
# Draw 'S' using 'X' markers
= np.array([13, 17, 19])
xs_plus = sigmoid(xs_plus)
ys_plus ='white', edgecolor='black', marker='X', s=300, zorder=4)
ax.scatter(xs_plus, ys_plus, color
# Draw 'S' using 'o' markers
= np.array([-10, -14, -18])
xs_o = sigmoid(xs_o)
ys_o ='white', edgecolor='black', marker='o', s=300, zorder=4)
ax.scatter(xs_o, ys_o, color
# Draw 'L' shape
= sigmoid(7)
l_height = FancyBboxPatch((7, 0), 0.5, l_height, boxstyle="round,pad=0.1", facecolor='navy', edgecolor='black', lw=2)
vertical_part = FancyBboxPatch((7, 0), 3, 0.5, boxstyle="round,pad=0.1", facecolor='navy', edgecolor='black', lw=2)
horizontal_part
# Add the L-shape to the plot
ax.add_patch(vertical_part)
ax.add_patch(horizontal_part)
# Add shadow to 'L' shape
= FancyBboxPatch((7.05, -0.05), 0.5, l_height, boxstyle="round,pad=0.1", facecolor='grey', alpha=0.3, zorder=1)
vertical_shadow = FancyBboxPatch((7.05, -0.05), 3, 0.5, boxstyle="round,pad=0.1", facecolor='grey', alpha=0.3, zorder=1)
horizontal_shadow
ax.add_patch(vertical_shadow)
ax.add_patch(horizontal_shadow)
# Set the face color of the plot area to grey
'#F4F4F0')
ax.set_facecolor(
# Remove ticks and labels
ax.set_xticks([])
ax.set_yticks([])
# Remove spines
'top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.spines[
plt.show()
import numpy as np
import matplotlib.pyplot as plt
def make_logo(fig_size=(10, 5), color='navy'):
# Sigmoid function
def sigmoid(x):
return 1 / (1 + np.exp(-x))
# Generate data
= np.linspace(-20, 20, 1200)
x_range = sigmoid(x_range)
y_range
= plt.subplots(figsize=fig_size)
fig, ax
# Plot sigmoid function with shadow
='Sigmoid Function', color=color, lw=10, zorder=3)
ax.plot(x_range, y_range, label- 0.03, color='grey', lw=10, alpha=0.4, zorder=2)
ax.plot(x_range, y_range
# Draw 'S' using 'X' markers
= np.array([13, 17, 19])
xs_plus = sigmoid(xs_plus)
ys_plus ='white', edgecolor='black', marker='X', s=300, zorder=4)
ax.scatter(xs_plus, ys_plus, color
# Draw 'S' using 'o' markers
= np.array([-10, -14, -18])
xs_o = sigmoid(xs_o)
ys_o ='white', edgecolor='black', marker='o', s=300, zorder=4)
ax.scatter(xs_o, ys_o, color
# Draw thick 'L' shaped coordinate axes
0, 20], [0, 0], color=color, lw=8, zorder=3) # Positive x-axis
ax.plot([0, 0], [0, 1], color=color, lw=8, zorder=3) # Positive y-axis
ax.plot([
# Draw shadow for 'L' shaped coordinate axes
0, 20], [-0.02, -0.02], color='grey', lw=8, alpha=0.4, zorder=2) # Shadow for x-axis
ax.plot([0.05, 0.05], [0, 1], color='grey', lw=8, alpha=0.4, zorder=2) # Shadow for y-axis
ax.plot([
# Set the face color of the plot area to grey
'#F4F4F0')
ax.set_facecolor(
# Remove ticks and labels
ax.set_xticks([])
ax.set_yticks([])
# Remove spines
'top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.spines[
make_logo()
=(8, 4), color='green') make_logo(fig_size
=(8, 4), color='red') make_logo(fig_size
=(8, 4), color='black') make_logo(fig_size
=(8, 4), color='navy') make_logo(fig_size
='#4169E1') make_logo(color
='#9932CC') make_logo(color
='#DAA520') make_logo(color
='#B22222') make_logo(color
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import font_manager as fm
def make_logo(fig_size=(10, 5), color='navy'):
# Sigmoid function
def sigmoid(x):
return 1 / (1 + np.exp(-x))
# Generate data
= np.linspace(-20, 20, 1200)
x_range = sigmoid(x_range)
y_range
= plt.subplots(figsize=fig_size)
fig, ax
# Plot sigmoid function with shadow
='Sigmoid Function', color=color, lw=10, zorder=3)
ax.plot(x_range, y_range, label- 0.03, color='grey', lw=10, alpha=0.4, zorder=2)
ax.plot(x_range, y_range
# Draw 'S' using 'X' markers
= np.array([13, 17, 19])
xs_plus = sigmoid(xs_plus)
ys_plus ='white', edgecolor='black', marker='X', s=300, zorder=4)
ax.scatter(xs_plus, ys_plus, color
# Draw 'S' using 'o' markers
= np.array([-10, -14, -18])
xs_o = sigmoid(xs_o)
ys_o ='white', edgecolor='black', marker='o', s=300, zorder=4)
ax.scatter(xs_o, ys_o, color
# Draw thick 'L' shaped coordinate axes
0, 20], [0, 0], color=color, lw=8, zorder=3) # Positive x-axis
ax.plot([0, 0], [0, 1], color=color, lw=8, zorder=3) # Positive y-axis
ax.plot([
# Draw shadow for 'L' shaped coordinate axes
0, 20], [-0.02, -0.02], color='grey', lw=8, alpha=0.4, zorder=2) # Shadow for x-axis
ax.plot([0.05, 0.05], [0, 1], color='grey', lw=8, alpha=0.4, zorder=2) # Shadow for y-axis
ax.plot([
# Set the face color of the plot area to grey
'#F4F4F0')
ax.set_facecolor(
# Remove ticks and labels
ax.set_xticks([])
ax.set_yticks([])
# Remove spines
'top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.spines[
# Add text in beautiful font
= fm.FontProperties(fname=fm.findSystemFonts(fontpaths=None, fontext='ttf')[0], size=20)
prop 1.02, 0.7, 'Sustainability Lab', ha='center', va='center', transform=ax.transAxes, fontproperties=prop, fontsize=64, color=color, fontweight='bold')
ax.text(1.02, 0.5, 'AI and Sensing for Sustainability', ha='center', va='center', transform=ax.transAxes, fontproperties=prop, fontsize=36, color=color)
ax.text(
'#F4F4F0')
fig.patch.set_facecolor(
# Example usage with 'Royal Blue'
='tomato') make_logo(color
='navy') make_logo(color