Skip to content

Instantly share code, notes, and snippets.

@L-Kov
Last active June 13, 2021 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save L-Kov/e20ffecca681255643afef09fb7006a0 to your computer and use it in GitHub Desktop.
Save L-Kov/e20ffecca681255643afef09fb7006a0 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import numpy as np
import math
## Define functions and set domain
x = np.arange(1, 2.0, .01)
y = x**2 -1
z = np.log(x)
i = x*z
j = x -1
## Plot the functions
plt.plot(x, y, 'r-')
plt.plot(x, z, 'b-')
plt.plot(x, i, 'c-')
plt.plot(x, j, 'g-')
## Configure the graph
plt.title('Network Effects')
plt.xlabel('X')
plt.ylabel('Y')
plt.grid(True)
plt.legend(['y = x^2', 'y = log(x)', 'y = xlog(x)', 'y = x'], loc='upper left')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment