Created
March 1, 2018 16:10
-
-
Save GeorgeSeif/c8078ed9d3a1b0443ef99552b8f434a4 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
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| def scatterplot(x_data, y_data, x_label="", y_label="", title="", color = "r", yscale_log=False): | |
| # Create the plot object | |
| _, ax = plt.subplots() | |
| # Plot the data, set the size (s), color and transparency (alpha) | |
| # of the points | |
| ax.scatter(x_data, y_data, s = 10, color = color, alpha = 0.75) | |
| if yscale_log == True: | |
| ax.set_yscale('log') | |
| # Label the axes and provide a title | |
| ax.set_title(title) | |
| ax.set_xlabel(x_label) | |
| ax.set_ylabel(y_label) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment