Skip to content

Commit

Permalink
feat: Add starter code to plot scatterplot based on df, x, y
Browse files Browse the repository at this point in the history
  • Loading branch information
iamMoid committed Jan 19, 2022
1 parent 9145ee5 commit 31b83cd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/magmaviz/scatterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,14 @@ def scatterplot(df, x, y, c=""):
assert is_numeric_dtype(df[y]), "The column assigned to 'y' axis is not of type numeric."

# check if color column is numeric or not
assert is_string_dtype(df[c]), "The column assigned to 'color' is not of type string."
assert is_string_dtype(df[c]), "The column assigned to 'color' is not of type string."

if c == "":
plot = alt.Chart(
data=df
).mark_point(
color="purple"
).encode(
alt.X(x, title=f"{x}"),
alt.Y(y, title=f"{y}")
)

0 comments on commit 31b83cd

Please sign in to comment.