Repository: Ultraplot/UltraPlot

Issue:
Edgecolor not set on scatter
> I'm reopening this issue because I think it is related. Sometimes edgecolor is ignored. Let's see an example:
> 
> ```
> d = pd.DataFrame(dict(x=[1, 2], y=[1, 2], sizes=[300, 300]))
> fig, ax = pplt.subplots(ncols=3)
> ax[0].scatter("x", "y", s="sizes", data=d, fc="red8", ec="none", alpha=1)
> ax[1].scatter("x", "y", s="sizes", data=d.loc[1], fc="red8", ec="none", alpha=1)
> ax[2].scatter("x", "y", s="sizes", data=d.loc[1], fc="red8", ec="none")
> ax.format(
>     xlim=(0.8, 2.2),
>     ylim=(0.9, 2.1),
>     suptitle="ax[0]: Right ec with len(d)>1 and alpha"
>     + "\nax[1]:Wrong ec with len(d)=1 and alpha"
>     + "\nax[2]: Right ec with len(d)=1 and no alpha",
>     suptitle_kw={"ha": "left"},
> )
> ```
> 
> Seemed like edgecolor is only ignored when plotting data from a dataframe with only one row of data (len(d)==1), and alpha is given.
> 
> And, why has `ha=left` for suptitle been ignored? How can I make the suptitle align left horizontally?
> 
> <img width="509" height="509" alt="Image" src="https://github.com/user-attachments/assets/89cf93ec-4788-49de-a65a-64b674c0b608" /> 

 _Originally posted by @gepcel in [#311](https://github.com/Ultraplot/UltraPlot/issues/311#issuecomment-3216639535)_

Discussion:

Fix (patch):
diff --git a/ultraplot/internals/inputs.py b/ultraplot/internals/inputs.py
index 25bcbf6e..ef3fe387 100644
--- a/ultraplot/internals/inputs.py
+++ b/ultraplot/internals/inputs.py
@@ -247,6 +247,7 @@ def _from_data(data, *args):
     if data is None:
         return
     args = list(args)
+    found_in_data = False
     for i, arg in enumerate(args):
         if isinstance(arg, str):
             try:
@@ -255,6 +256,13 @@ def _from_data(data, *args):
                 pass
             else:
                 args[i] = array
+                found_in_data = True
+
+    # If only one argument and it wasn't found in data, return the original scalar
+    # This prevents scalar values like "none" from becoming ["none"]
+    if len(args) == 1 and not found_in_data:
+        return args[0]
+
     return args
 
 


Test changes:
diff --git a/ultraplot/tests/test_1dplots.py b/ultraplot/tests/test_1dplots.py
index 84debe9c..eee2178b 100644
--- a/ultraplot/tests/test_1dplots.py
+++ b/ultraplot/tests/test_1dplots.py
@@ -295,6 +295,46 @@ def test_scatter_args(rng):
     return fig
 
 
+@pytest.mark.mpl_image_compare
+def test_scatter_edgecolor_single_row():
+    """
+    Test that edgecolor is properly handled for single-row DataFrame input.
+    This is a regression test for issue #324.
+    """
+    import pandas as pd
+
+    # Create test data
+    df_multi = pd.DataFrame({"x": [1, 2], "y": [1, 2], "sizes": [300, 300]})
+    df_single = pd.DataFrame({"x": [2], "y": [2], "sizes": [300]})
+
+    fig, axs = uplt.subplots(ncols=3, share=0)
+
+    # Test multiple rows with alpha
+    result1 = axs[0].scatter(
+        "x", "y", s="sizes", data=df_multi, fc="red8", ec="none", alpha=1
+    )
+
+    # Test single row with alpha (the problematic case)
+    result2 = axs[1].scatter(
+        "x", "y", s="sizes", data=df_single, fc="red8", ec="none", alpha=1
+    )
+
+    # Test single row without alpha
+    result3 = axs[2].scatter("x", "y", s="sizes", data=df_single, fc="red8", ec="none")
+
+    # Verify that edgecolors are correctly set to no edges for all cases
+    # An empty array means no edges (which is what 'none' should produce)
+    assert len(result1.get_edgecolors()) == 0, "Multiple rows should have no edges"
+    assert (
+        len(result2.get_edgecolors()) == 0
+    ), "Single row with alpha should have no edges"
+    assert (
+        len(result3.get_edgecolors()) == 0
+    ), "Single row without alpha should have no edges"
+
+    return fig
+
+
 @pytest.mark.mpl_image_compare
 def test_scatter_inbounds():
     """