In [5]:
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import pandas as pd
import matplotlib.image as mpimg
from mpl_toolkits.mplot3d import Axes3D
import requests
import random


/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

In [ ]:
img=mpimg.imread('tall_logo.png')

In [6]:
fontsizes = [8, 16, 24, 32]
def example_plot(ax):
    ax.plot([2, 1])
    ax.set_xlabel('x-label', fontsize=random.choice(fontsizes))
    ax.set_ylabel('y-label', fontsize=random.choice(fontsizes))
    ax.set_title('Title', fontsize=random.choice(fontsizes))

In [ ]:
"""
MapReduce
The Curse of Dimensionality
Anscombe's Quartet
Natural Language Processing
MCMC
Markov Chains
OLS
k-means
Chi-Squared Test
Partially Observable State Spaces
Data Provenance
Belief in Santa
The Battle of the Sexes
The Girlfriend Equation
Monkeys on Typewriters
Is the Internet Secure?
The T-Test
Selection Bias
Confidence Intervals
Value of Information
Decision Tree Learning
Ant Colony Optimization
Cross Validation
Experimental Design
Bayesian Updating
p-values
"""

In [74]:
fig = plt.figure(figsize=(10,10), facecolor='#383838')
#plt.rc('text', usetex=True)
x = np.arange(5)

ax1 = plt.subplot2grid((6, 5), (0, 0), colspan=2, rowspan=4)
ax2 = plt.subplot2grid((6, 5), (0, 2), colspan=3, rowspan=1)
ax3 = plt.subplot2grid((6, 5), (1, 2), colspan=3, rowspan=3)
ax4 = plt.subplot2grid((6, 5), (4, 0), colspan=5, rowspan=2)

ax1.imshow(img)
ax1.plot([10,1,10])
ax1.grid(False)
ax1.axis('off')

ax2.grid(False)
ax2.axis('off')

ax3.patch.set_alpha(0.0)
d1 = 1.*np.arange(100)/100
d2 = 1.*np.arange(100)/100
o1 = (1 - d2) / (1 - d1 * d2)
o2 = d2 * (1 - d2) / (1 - d1 * d2)
ax3.plot(d1, o1, color='#ffffff', linewidth=4)
ax3.plot(d1, o2, color='#ffffff', linewidth=4)
ax3.set_title('')

ax3.set_xticklabels([])
ax3.set_yticklabels([])
ax3.grid(False)

ax4.set_xlim(0,10)
ax4.set_ylim(0,10)
ax4.text(5, 3, "Stationarity and Differencing", color="white", fontsize=50, horizontalalignment='center', weight='bold')
ax4.grid(False)
ax4.axis('off')


plt.tight_layout()
fig.savefig('stationarity-and-differencing.png', bbox_inches='tight', facecolor=fig.get_facecolor())



In [72]:
fig = plt.figure(figsize=(10,10), facecolor='#383838')
#plt.rc('text', usetex=True)
x = np.arange(5)

ax1 = plt.subplot2grid((6, 5), (0, 0), colspan=2, rowspan=4)
ax2 = plt.subplot2grid((6, 5), (0, 2), colspan=3, rowspan=1)
ax3 = plt.subplot2grid((6, 5), (1, 2), colspan=3, rowspan=3)
ax4 = plt.subplot2grid((6, 5), (4, 0), colspan=5, rowspan=2)

ax1.imshow(img)
ax1.plot([10,1,10])
ax1.grid(False)
ax1.axis('off')

ax2.grid(False)
ax2.axis('off')

ax3.patch.set_alpha(0.0)
d1 = 1.*np.arange(100)/100
d2 = 1.*np.arange(100)/100
o1 = (1 - d2) / (1 - d1 * d2)
o2 = d2 * (1 - d2) / (1 - d1 * d2)
ax3.plot(d1, o1, color='#ffffff', linewidth=4)
ax3.plot(d1, o2, color='#ffffff', linewidth=4)
ax3.set_title('')

ax3.set_xticklabels([])
ax3.set_yticklabels([])
ax3.grid(False)

ax4.set_xlim(0,10)
ax4.set_ylim(0,10)
ax4.text(5, 3, "Bargaining", color="white", fontsize=55, horizontalalignment='center', weight='bold')
ax4.grid(False)
ax4.axis('off')


plt.tight_layout()
fig.savefig('bargaining.png', bbox_inches='tight', facecolor=fig.get_facecolor())



In [17]:
import json
median = '[381200.0, 380969.0, 384357.0, 383214.0, 384321.0, 384375.0, 384571.0, 377846.0, 367714.0, 362143.0, 348333.0, 349286.0, 351929.0, 361750.0, 361900.0, 353979.0, 348536.0, 357421.0, 347033.0, 329143.0, 322857.0, 330150.0, 310400.0, 311583.0, 337442.0, 345208.0, 365000.0, 354500.0, 358429.0, 355429.0, 355643.0, 339333.0, 301357.0, 310200.0, 317800.0, 326107.0, 332000.0, 337679.0, 316800.0, 316450.0, 303321.0, 302698.0, 307058.0, 314851.0, 319588.0, 325500.0, 327000.0, 322857.0, 321571.0, 321143.0, 318828.0, 324167.0, 327800.0, 329000.0, 328317.0, 323800.0, 319875.0, 316086.0, 321821.0, 312857.0, 299757.0, 296000.0, 304143.0, 316750.0, 309833.0, 312250.0, 312700.0, 314883.0, 326668.0, 328395.0, 325008.0, 324114.0, 326286.0, 335857.0, 327571.0, 327333.0, 328429.0, 329000.0, 329875.0, 333000.0, 332536.0, 324429.0, 320071.0, 329167.0, 330100.0, 324500.0, 322307.0, 312964.0, 313739.0, 316054.0, 336393.0, 337493.0, 323071.0, 319271.0, 319257.0, 313971.0, 333714.0, 338557.0, 349657.0, 349129.0, 337857.0, 336833.0, 321357.0, 332357.0, 337000.0, 346750.0, 341557.0, 327857.0, 325857.0, 326571.0, 322986.0, 326143.0, 334214.0, 329714.0, 322643.0, 324000.0, 326068.0, 327557.0, 330339.0, 324143.0, 324275.0, 326246.0, 335700.0, 340699.0, 336429.0, 347857.0, 349357.0, 349479.0, 349214.0, 346429.0, 342500.0, 343564.0, 343414.0, 342357.0, 339929.0, 332143.0, 345000.0, 345643.0, 351000.0, 351143.0, 355333.0, 352421.0, 343625.0, 345000.0, 345000.0, 343400.0, 345483.0, 359031.0, 359975.0, 362390.0, 367571.0, 370064.0, 372021.0, 380907.0, 398400.0, 388479.0, 378350.0, 375814.0, 381243.0, 394500.0, 398100.0, 397250.0, 399786.0, 403571.0, 408929.0, 422571.0, 405643.0, 424250.0, 399000.0, 389000.0, 418417.0, 389621.0, 382821.0, 379907.0, 379529.0, 382500.0, 382483.0, 385907.0, 395143.0, 392207.0, 423786.0, 441693.0, 441117.0, 455000.0, 455707.0, 460714.0, 458429.0, 472571.0, 474286.0, 442714.0, 389621.0, 366764.0, 379900.0, 375692.0, 426536.0, 452286.0, 462514.0, 470929.0, 476833.0, 495857.0, 495286.0, 487042.0, 484214.0, 480857.0, 469833.0, 425250.0, 480500.0, 480800.0, 482250.0, 479000.0, 479000.0, 479000.0, 499333.0, 496500.0, 505800.0, 502125.0, 504883.0, 508488.0, 499567.0, 500713.0, 513307.0, 499600.0, 499225.0, 498000.0, 488271.0, 504321.0, 529000.0, 501225.0, 533171.0, 549900.0, 544616.0, 495000.0, 523389.0, 507174.0, 503666.0, 488670.0, 495479.0, 534671.0, 484050.0, 476714.0, 474857.0, 478571.0, 477857.0, 473714.0, 467336.0, 468700.0, 452143.0, 462000.0, 472000.0, 470750.0, 469571.0, 450812.0, 430883.0, 432500.0, 433214.0, 418557.0, 441786.0, 441786.0, 405000.0, 410242.0, 440417.0, 434500.0, 427571.0, 430571.0, 450000.0, 446500.0, 454150.0, 449500.0, 468708.0, 475000.0, 439186.0, 437350.0, 454950.0, 457875.0, 435000.0, 444950.0, 459900.0, 462121.0, 466143.0, 476000.0, 485000.0, 496500.0, 512000.0, 529020.0, 529000.0, 499879.0, 496617.0, 505950.0, 540608.0, 523500.0, 564500.0, 566458.0, 535000.0, 547350.0, 565698.0, 549750.0, 540569.0, 604465.0, 595500.0, 559905.0, 570719.0, 541538.0, 569715.0, 574314.0, 577146.0, 577179.0, 590000.0, 595000.0, 597500.0, 572840.0, 592500.0, 565557.0, 608543.0, 600000.0, 599000.0, 603167.0, 600000.0, 595190.0, 581225.0, 580614.0, 574950.0, 589000.0, 589000.0, 513208.0, 514863.0, 517739.0, 550000.0, 525235.0, 477186.0, 494286.0, 499000.0, 499750.0, 512000.0, 524167.0, 521286.0, 480714.0, 495571.0, 520786.0, 532264.0, 569179.0, 475525.0, 533250.0, 663893.0, 665357.0, 643667.0, 659000.0, 601493.0, 552957.0, 531414.0, 500814.0, 531207.0, 466786.0, 480500.0, 591071.0, 607857.0, 598921.0, 630300.0, 621664.0, 615650.0, 599000.0, 591643.0, 544500.0, 596429.0, 599375.0, 603750.0, 601964.0, 640307.0, 632429.0, 650000.0, 652500.0, 626429.0, 625563.0, 639667.0, 699356.0, 690908.0, 714450.0, 671693.0, 709200.0, 651400.0, 602857.0, 621143.0, 696428.0, 712714.0, 731428.0, 673286.0, 682492.0, 687750.0, 659032.0, 615000.0, 629571.0, 604483.0, 595000.0, 640750.0, 634288.0, 591000.0]'
median = json.loads(median)

In [50]:
fig = plt.figure(figsize=(10,10), facecolor='#383838')
#plt.rc('text', usetex=True)
x = np.arange(5)

ax1 = plt.subplot2grid((6, 5), (0, 0), colspan=2, rowspan=4)
ax2 = plt.subplot2grid((6, 5), (0, 2), colspan=3, rowspan=1)
ax3 = plt.subplot2grid((6, 5), (1, 2), colspan=3, rowspan=3)
ax4 = plt.subplot2grid((6, 5), (4, 0), colspan=5, rowspan=2)

ax1.imshow(img)
ax1.plot([10,1,10])
ax1.grid(False)
ax1.axis('off')

ax2.grid(False)
ax2.axis('off')

ax3.patch.set_alpha(0.0)
ax3.patch.set_alpha(0.0)
ax3.patch.set_label('')
tsaplots.plot_acf(df[0:10], ax=ax3, linewidth=5, color='#ffffff')
ax3.set_title('')

ax3.set_xticklabels([])
ax3.set_yticklabels([])
ax3.grid(False)

ax4.set_xlim(0,10)
ax4.set_ylim(0,10)
ax4.text(5, 3, "Auto-correlative Function,\n and Correlograms", color="white", fontsize=55, horizontalalignment='center', weight='bold')
ax4.grid(False)
ax4.axis('off')


plt.tight_layout()
fig.savefig('acf.png', bbox_inches='tight', facecolor=fig.get_facecolor())



In [5]:
fig = plt.figure(figsize=(10,10), facecolor='#383838')
#plt.rc('text', usetex=True)
x = np.arange(5)

ax1 = plt.subplot2grid((6, 5), (0, 0), colspan=2, rowspan=4)
ax2 = plt.subplot2grid((6, 5), (0, 2), colspan=3, rowspan=1)
ax3 = plt.subplot2grid((6, 5), (1, 2), colspan=3, rowspan=3)
ax4 = plt.subplot2grid((6, 5), (4, 0), colspan=5, rowspan=2)

ax1.imshow(img)
ax1.plot([10,1,10])
ax1.grid(False)
ax1.axis('off')

ax2.grid(False)
ax2.axis('off')

exp = [
    [1,0,0,0,1,1],
    [1,1,0,0,0,0],
    [1,0,1,0,0,1],
    [1,1,1,0,1,0],
    [1,0,0,1,1,0],
    [1,1,0,1,0,1],
    [1,0,1,1,0,0],
    [1,1,1,1,1,1]
]

ax3.imshow(np.array(exp)*10, interpolation='none', cmap='gray')

ax3.set_xticklabels([])
ax3.set_yticklabels([])
ax3.grid(False)

ax4.set_xlim(0,10)
ax4.set_ylim(0,10)
ax4.text(5, 3, "Fractional Factorial Design", color="white", fontsize=55, horizontalalignment='center', weight='bold')
ax4.grid(False)
ax4.axis('off')


plt.tight_layout()
fig.savefig('fractional-factorial-design.png', bbox_inches='tight', facecolor=fig.get_facecolor())



In [11]:
fig = plt.figure(figsize=(10,10), facecolor='#383838')
#plt.rc('text', usetex=True)
x = np.arange(5)

ax1 = plt.subplot2grid((6, 5), (0, 0), colspan=2, rowspan=4)
ax2 = plt.subplot2grid((6, 5), (0, 2), colspan=3, rowspan=1)
ax3 = plt.subplot2grid((6, 5), (1, 2), colspan=3, rowspan=3)
ax4 = plt.subplot2grid((6, 5), (4, 0), colspan=5, rowspan=2)

ax1.imshow(img)
ax1.plot([10,1,10])
ax1.grid(False)
ax1.axis('off')

ax2.grid(False)
ax2.axis('off')

x = np.arange(10)
y = [.1, .2, .4, 1.5, 1.7, 1.8, 1.86, 1.9, 1.92, 1.95]

ax3.patch.set_alpha(0.0)
ax3.plot(x,y, linewidth=5, color="#ffffff")
ax3.scatter(x, y, linewidth=10, color='#ebe728')
ax3.yaxis.set_ticks_position('left')
ax3.set_xticklabels([])
ax3.set_yticklabels([])

ax4.set_xlim(0,10)
ax4.set_ylim(0,10)
ax4.text(5, 3, "The Elbow Method", color="white", fontsize=55, horizontalalignment='center', weight='bold')
ax4.grid(False)
ax4.axis('off')


plt.tight_layout()
fig.savefig('elbow-method.png', bbox_inches='tight', facecolor=fig.get_facecolor())



In [18]:
fig = plt.figure(figsize=(10,10), facecolor='#383838')
#plt.rc('text', usetex=True)
x = np.arange(5)

ax1 = plt.subplot2grid((6, 5), (0, 0), colspan=2, rowspan=4)
ax2 = plt.subplot2grid((6, 5), (0, 2), colspan=3, rowspan=1)
ax3 = plt.subplot2grid((6, 5), (1, 2), colspan=3, rowspan=3)
ax4 = plt.subplot2grid((6, 5), (4, 0), colspan=5, rowspan=2)

ax1.imshow(img)
ax1.plot([10,1,10])
ax1.grid(False)
ax1.axis('off')

ax2.grid(False)
ax2.axis('off')

x = []
y = []
n=20
for i in range(n):
    x.append(1.0 * i / n)
    y.append(1.0 * i / n + (random.random() - 0.5)/3)

ax3.patch.set_alpha(0.0)
ax3.scatter(x, y, linewidth=10, color='#ebe728')
ax3.plot([0, 1], [0,1], linewidth=5, color="#ffffff")
ax3.yaxis.set_ticks_position('left')
ax3.set_xticklabels([])
ax3.set_yticklabels([])
ax3.set_xlim(0, 1)
ax3.set_ylim(0, 1)

ax4.set_xlim(0,10)
ax4.set_ylim(0,10)
ax4.text(5, 3, "R-squared", color="white", fontsize=55, horizontalalignment='center', weight='bold')
ax4.grid(False)
ax4.axis('off')


plt.tight_layout()
fig.savefig('r-squared.png', bbox_inches='tight', facecolor=fig.get_facecolor())



In [36]:
fig = plt.figure(figsize=(10,10), facecolor='#383838')
#plt.rc('text', usetex=True)
x = np.arange(5)

ax1 = plt.subplot2grid((6, 5), (0, 0), colspan=2, rowspan=4)
ax2 = plt.subplot2grid((6, 5), (0, 2), colspan=3, rowspan=1)
ax3 = plt.subplot2grid((6, 5), (1, 2), colspan=3, rowspan=3, projection='3d')
ax4 = plt.subplot2grid((6, 5), (4, 0), colspan=5, rowspan=2)

ax1.imshow(img)
ax1.plot([10,1,10])
ax1.grid(False)
ax1.axis('off')

ax2.grid(False)
ax2.axis('off')

n = 100
ax3.patch.set_alpha(0.0)
r = 0.01 * np.arange(0, 100)
xs = r
ys = xs + 10*np.random.rand(n)
zs = xs ** 2
ax3.scatter(xs, ys, zs, c='#ebe728', s=40)
ax3.w_xaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
ax3.w_yaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
ax3.w_zaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
ax3.xaxis.set_ticklabels([])
ax3.yaxis.set_ticklabels([])
ax3.zaxis.set_ticklabels([])

ax4.set_xlim(0,10)
ax4.set_ylim(0,10)
ax4.text(5, 3, "Multiple Regression", color="white", fontsize=55, horizontalalignment='center', weight='bold')
ax4.grid(False)
ax4.axis('off')


plt.tight_layout()
fig.savefig('multiple-regression.png', bbox_inches='tight', facecolor=fig.get_facecolor())



In [15]:
fig = plt.figure(figsize=(10,10), facecolor='#383838')
#plt.rc('text', usetex=True)
x = np.arange(5)

ax1 = plt.subplot2grid((6, 5), (0, 0), colspan=2, rowspan=4)
ax2 = plt.subplot2grid((6, 5), (0, 2), colspan=3, rowspan=1)
ax3 = plt.subplot2grid((6, 5), (1, 2), colspan=3, rowspan=3)
ax4 = plt.subplot2grid((6, 5), (4, 0), colspan=5, rowspan=2)

ax1.imshow(img)
ax1.plot([10,1,10])
ax1.grid(False)
ax1.axis('off')

ax2.grid(False)
ax2.axis('off')

x = [2,4,5,7,8,9]
y = [3,7,4,2,1,6]

ax3.patch.set_alpha(0.0)
ax3.plot([0, 7], [4,4], linewidth=3, color="#ffffff")
ax3.plot([7, 10], [6,6], linewidth=3, color="#ffffff")
ax3.plot([2, 2], [0,4], linewidth=3, color="#ebe728")
ax3.plot([4, 4], [4,10], linewidth=3, color="#ebe728")
ax3.plot([7, 7], [0,10], linewidth=3, color="#ebe728")
ax3.plot([8, 8], [0,6], linewidth=3, color="#ebe728")
ax3.scatter(x, y, linewidth=10, color='#ebe728')
ax3.spines['right'].set_linewidth(4)
ax3.spines['left'].set_linewidth(4)
ax3.spines['top'].set_linewidth(4)
ax3.spines['bottom'].set_linewidth(4)
ax3.yaxis.set_ticks_position('left')
ax3.set_xticklabels([])
ax3.set_yticklabels([])
ax3.set_xlim(0, 10)
ax3.set_ylim(0, 10)


ax4.set_xlim(0,10)
ax4.set_ylim(0,10)
ax4.text(5, 3, "k-d Trees", color="white", fontsize=80, horizontalalignment='center', weight='bold')
ax4.grid(False)
ax4.axis('off')


plt.tight_layout()
fig.savefig('k-d-trees.png', bbox_inches='tight', facecolor=fig.get_facecolor())



In [16]:
fig = plt.figure(figsize=(10,10), facecolor='#383838')
#plt.rc('text', usetex=True)
x = np.arange(5)

ax1 = plt.subplot2grid((6, 5), (0, 0), colspan=2, rowspan=4)
ax2 = plt.subplot2grid((6, 5), (0, 2), colspan=3, rowspan=1)
ax3 = plt.subplot2grid((6, 5), (1, 2), colspan=3, rowspan=3)
ax4 = plt.subplot2grid((6, 5), (4, 0), colspan=5, rowspan=2)

ax1.imshow(img)
ax1.plot([10,1,10])
ax1.grid(False)
ax1.axis('off')

ax2.grid(False)
ax2.axis('off')

ax4.set_xlim(0,2)
ax4.set_ylim(0,3)
ax4.text(1, 1, "Bonferroni Correction", color="white", fontsize=60, horizontalalignment='center', weight='bold')
ax4.grid(False)
ax4.axis('off')

n = np.arange(20)+1
alpha = 0.05

ax3.patch.set_alpha(0.0)
ax3.plot(n, alpha/n, linewidth=5, color='#ebe728')
ax3.spines['right'].set_visible(False)
ax3.spines['left'].set_linewidth(4)
ax3.spines['top'].set_visible(False)
ax3.spines['bottom'].set_linewidth(4)
ax3.yaxis.set_ticks_position('left')
ax3.set_xticklabels([])
ax3.set_yticklabels([])

ax3.set_xlabel(r'comparisons ($n$)', fontsize=22, color='#ffffff')
ax3.set_ylabel(r'$\frac{\alpha}{n}$', fontsize=40, color='#ffffff')

plt.tight_layout()
fig.savefig('bonferroni_correction.png', bbox_inches='tight', facecolor=fig.get_facecolor())



In [ ]: