Skip to content

Commit

Permalink
feat: small changes to code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mukund Iyer committed Jan 29, 2022
1 parent 853cfa0 commit a7f8299
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/magmaviz/boxplot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import altair as alt
import pandas as pd
import numpy as np
from vega_datasets import data
import re


Expand Down Expand Up @@ -66,14 +65,13 @@ def boxplot(df, x, y, facet=False):
.encode(
x=alt.X(x, title=x_title),
y=alt.Y(y, title=y_title),
color=alt.Color(y, scale=alt.Scale(scheme="magma")),
color=alt.Color(y, scale=alt.Scale(scheme="magma"), legend=None),
)
)

# facet if required

if facet == True:
return plot.facet(row=y)
return plot.encode(x=alt.X(x, title=None), y=alt.Y(y, title=None)).facet(row=y)

else:
return plot

0 comments on commit a7f8299

Please sign in to comment.