Last active
August 7, 2019 18:03
-
-
Save GeorgeSeif/5f1b2d650ce95efcc69d1fae77f0deca to your computer and use it in GitHub Desktop.
This file contains 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