Skip to content

Instantly share code, notes, and snippets.

@kayhman
Created September 8, 2020 08:17
Show Gist options
  • Save kayhman/647bb902717fff5ae6d070643feac999 to your computer and use it in GitHub Desktop.
Save kayhman/647bb902717fff5ae6d070643feac999 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
for alpha in np.linspace(0.1, 0.9, 5):
x = np.array(range(-10, 11))
y = np.where(x > 0, alpha * x, (alpha - 1) * x)
plt.plot(x, y, label=f'Q = {alpha}')
plt.legend(loc='upper left')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment