diff --git a/lib/gear/plotting.py b/lib/gear/plotting.py index 31398a43..fc5ee254 100644 --- a/lib/gear/plotting.py +++ b/lib/gear/plotting.py @@ -472,20 +472,16 @@ def generate_plot(df, x=None, y=None, z=None, facet_row=None, facet_col=None, facet_col_groups = [] if facet_row: - facet_row_groups = category_orders[facet_row] if facet_row in category_orders else df[facet_row].unique() + facet_row_groups = category_orders[facet_row] if facet_row in category_orders else df[facet_row].unique().tolist() if facet_col: - facet_col_groups = category_orders[facet_col] if facet_col in category_orders else df[facet_col].unique() + facet_col_groups = category_orders[facet_col] if facet_col in category_orders else df[facet_col].unique().tolist() facet_row_indexes = {group: idx for idx, group in enumerate(facet_row_groups, start=1)} num_rows = len(facet_row_groups) if facet_row else 1 facet_col_indexes = {group: idx for idx, group in enumerate(facet_col_groups, start=1)} num_cols = len(facet_col_groups) if facet_col else 1 - # Ensure facet_row_groups and facet_col_groups elements are cast as strings - facet_row_groups = [str(group) for group in facet_row_groups] - facet_col_groups = [str(group) for group in facet_col_groups] - # Make faceted plot fig = make_subplots(rows=num_rows , cols=num_cols