Skip to content

Instantly share code, notes, and snippets.

@kperry2215
Created July 4, 2019 22:45
Show Gist options
  • Save kperry2215/321ae9072067626888c6daa5d22f55aa to your computer and use it in GitHub Desktop.
Save kperry2215/321ae9072067626888c6daa5d22f55aa to your computer and use it in GitHub Desktop.
def plot_actual_vs_predicted_by_equations(df, x_variable, y_variables, plot_title):
"""
This function is used to map x- and y-variables against each other
Arguments:
df: Pandas dataframe.
x_variable: String. Name of the column that we want to set as the
x-variable in the plot
y_variables: string (single), or list of strings (multiple). Name(s)
of the column(s) that we want to set as the y-variable in the plot
"""
#Plot results
df.plot(x=x_variable, y=y_variables, title=plot_title)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment