Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ultraplot/axes/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions ultraplot/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Loading