diff --git a/ultraplot/axes/plot.py b/ultraplot/axes/plot.py index ac81fcfea..bec31758e 100644 --- a/ultraplot/axes/plot.py +++ b/ultraplot/axes/plot.py @@ -2509,7 +2509,7 @@ def _parse_color(self, x, y, c, *, apply_cycle=True, infer_rgb=False, **kwargs): # functions and helper functions. parsers = (self._parse_cmap, *self._level_parsers) if c is None or mcolors.is_color_like(c): - if infer_rgb and c is not None: + if infer_rgb and c is not None and c != "none": c = pcolors.to_hex(c) # avoid scatter() ambiguous color warning if apply_cycle: # False for scatter() so we can wait to get correct 'N' kwargs = self._parse_cycle(**kwargs) diff --git a/ultraplot/tests/test_plot.py b/ultraplot/tests/test_plot.py index 98a7d2495..6f09e1834 100644 --- a/ultraplot/tests/test_plot.py +++ b/ultraplot/tests/test_plot.py @@ -420,3 +420,16 @@ def test_pie_labeled_series_in_dataframes(): for text, index in zip(texts, data.index): assert text.get_text() == index uplt.close(fig) + + +def test_color_parsing_for_none(): + """ + Ensure that none is not parsed to white + """ + fig, ax = uplt.subplots() + ax.scatter(0.4, 0.5, 100, fc="none", ec="k", alpha=0.2) + ax.scatter(0.5, 0.5, 100, fc="none", ec="k") + ax.scatter(0.6, 0.5, 100, fc="none", ec="k", alpha=1) + for artist in ax[0].collections: + assert artist.get_facecolor().shape[0] == 0 + uplt.close(fig)