Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 17, 2020 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/c0adf037bb795daec985270fc3d98a4d to your computer and use it in GitHub Desktop.
Save velotiotech/c0adf037bb795daec985270fc3d98a4d to your computer and use it in GitHub Desktop.
# function to plot the graphs for average revenues or profits of the fortune 500 companies against year
def plot(x, y, ax, title, y_label):
ax.set_title(title)
ax.set_ylabel(y_label)
ax.plot(x, y)
ax.margins(x=0, y=0)
# function to plot the graphs with superimposed standard deviation
def plot_with_std(x, y, stds, ax, title, y_label):
ax.fill_between(x, y - stds, y + stds, alpha=0.2)
plot(x, y, ax, title, y_label)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment