From 35ab01d92e8ffe93a9fbbc784edb0dbe2d66643f Mon Sep 17 00:00:00 2001 From: Eachan Johnson Date: Sat, 5 Oct 2024 14:31:28 +0100 Subject: [PATCH] Fix numpy dependency and reference to values --- carabiner/mpl/utils.py | 5 ++++- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/carabiner/mpl/utils.py b/carabiner/mpl/utils.py index 4311a29..643d16c 100644 --- a/carabiner/mpl/utils.py +++ b/carabiner/mpl/utils.py @@ -12,6 +12,7 @@ "\n\t$ pip install carabiner[mpl]\n") else: from matplotlib import axes, cycler, figure, rcParams + import numpy as np from pandas import DataFrame from tqdm.auto import tqdm @@ -176,6 +177,7 @@ def scattergrid( extras = {"label": group_name} if not dummy_group else {} if grid_row_name == grid_col_name: if xscale == "log": + values = group_df[grid_col_name].values bins = np.geomspace( values.min(), values.max(), @@ -203,5 +205,6 @@ def scattergrid( xlabel=grid_col_name, ylabel=ylabel, ) - ax.legend(**_legend_opts) + if not dummy_group: + ax.legend(**_legend_opts) return fig, axes \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6c088a3..4c6cb20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ dependencies = [ [project.optional-dependencies] deep = ["tensorflow"] -mpl = ["pandas", "matplotlib"] +mpl = ["pandas", "matplotlib", "numpy"] pd = ["pandas"] all = ["carabiner-tools[deep,mpl,pd]"]