Created
July 15, 2019 00:05
-
-
Save kperry2215/f3821b9b774bf99e0e803200a2b9fc6f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_plot(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 | |
Outputs: | |
Scatter plot in console. | |
""" | |
#Plot results | |
df.plot(x=x_variable, y=y_variables, title=plot_title) | |
plt.show() | |
""" | |
Main script execution here | |
""" | |
generate_plot(dataframe, x_variable='JobStartDate', | |
y_variables=['TotalBaseWaterVolume'], | |
plot_title='Total Base Water Volume for Fracs over Time') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment