Skip to content

Instantly share code, notes, and snippets.

@jbn
Created September 2, 2017 00:05
Show Gist options
  • Save jbn/2f14034c0ac7bccce38f975b8264e906 to your computer and use it in GitHub Desktop.
Save jbn/2f14034c0ac7bccce38f975b8264e906 to your computer and use it in GitHub Desktop.
continue_of_harm
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
fig, ax = plt.subplots(4, 1, figsize=(10, 12), sharex=True, sharey=True)
plt.xkcd()
x = np.linspace(-10, 10, 1001)
np.random.seed(43)
ax[0].set_title("How People Think Laws Work")
ax[0].plot(x[x<0], x[x<0]*0)
ax[0].plot(x[x>0], x[x>0]/x[x>0], color='darkred')
ax[0].vlines(0, -0.2, 1.2)
ax[0].annotate('hard boundary',
xy=(-0.1, 0.5),
xytext=(-6, 0.75),
arrowprops=dict(facecolor='black', shrink=0.05))
ax[1].set_title("How Laws Work Generally")
ax[1].plot(x, 1/(1+np.exp(-x)), color='purple')
lines = np.random.randn(25)
max_l = lines.max()
for r in lines:
ax[1].vlines(0+r, -0.2, 1.2, alpha=0.1)
ax[1].annotate('fuzzy boundary',
xy=(0, 0.5),
xytext=(-6, 0.75),
arrowprops=dict(facecolor='black', shrink=0.05))
plt.ylabel("Continuum of Harm")
plt.xlabel("Continuum of 'Don't do that'")
ax[2].set_title("How Laws Work For Rich People")
ax[2].plot(x, 1/(1+np.exp(-x)), color='purple')
for r in lines:
ax[2].vlines(0+r, -0.2, 1.2, alpha=0.1)
ax[2].vlines(0+max_l, -0.2, 1.2, alpha=1)
ax[2].annotate('pick your boundary',
xy=(max_l, 0.7),
xytext=(5, 0.25),
arrowprops=dict(facecolor='black', shrink=0.05))
ax[3].set_title("How Laws Work For Poor, Black People")
ax[3].plot(x, 1/(1+np.exp(-x)), color='purple')
for r in lines:
ax[3].vlines(0+r, -0.2, 1.2, alpha=0.1)
ax[3].vlines(0+lines.min(), -0.2, 1.2, alpha=1)
ax[3].annotate("racism",
xy=(lines.min(), 0.7),
xytext=(-5, 0.25),
arrowprops=dict(facecolor='black', shrink=0.05))
for i in range(4):
ax[i].spines['right'].set_color('none')
ax[i].spines['top'].set_color('none')
ax[i].set_ylabel("Continuum of Social Harm")
ax[i].set_xlabel("Continuum of 'You should not and cannot do that!'")
plt.xticks([])
plt.yticks([])
plt.tight_layout()
plt.savefig("law.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment