Skip to content

Instantly share code, notes, and snippets.

@rhoit
Created November 20, 2020 04:29
Show Gist options
  • Save rhoit/cb260a69d9f2100990b04dffe699aa68 to your computer and use it in GitHub Desktop.
Save rhoit/cb260a69d9f2100990b04dffe699aa68 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
def myplot(x, y, **kwargs):
plt.plot(x, y, **kwargs)
plt.xlabel('X')
plt.ylabel('Y')
plt.title('My plot')
plt.show()
x = [1, 3, 4, 5]
y = [3, 6, 9, 12]
myplot(x, y, color='orange', marker='s')
# you can use a dictionary as kwargs
d = {'color':'magenta', 'marker':'d'}
myplot(x, y, **d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment