Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Bug]: Markers with numeric name like CARETLEFT cannot be specified using a cycler #27596

Copy link
Copy link
Closed
@castilma

Description

@castilma
Issue body actions

Bug summary

I want to cycle between multiple markerstyles, including those with a numeric value like CARETRIGHT as documented here, but I get an exception if I add one of those.

Code for reproduction

#!/usr/bin/env python3

from cycler import cycler
import matplotlib.pyplot as plt
import matplotlib.markers as mk

cycle = cycler(marker=["+",mk.CARETRIGHT])

t=[0,1]
y=[5,6]

plt.rc('axes', prop_cycle=cycle)
plt.plot(t,y)
plt.show()

Actual outcome

Traceback (most recent call last):
  File "/home/mcd/bugs/bug-cycler.py", line 11, in <module>
    plt.rc('axes', prop_cycle=cycle)
  File "/usr/lib/python3.11/site-packages/matplotlib/pyplot.py", line 670, in rc
    matplotlib.rc(group, **kwargs)
  File "/usr/lib/python3.11/site-packages/matplotlib/__init__.py", line 1062, in rc
    rcParams[key] = v
    ~~~~~~~~^^^^^
  File "/usr/lib/python3.11/site-packages/matplotlib/__init__.py", line 734, in __setitem__
    raise ValueError(f"Key {key}: {ve}") from None
ValueError: Key axes.prop_cycle: Could not convert 5 to str

Expected outcome

A plot using CARETLEFT as marker.

Additional information

This seems like it has to do with the fact, that some markers are referred to by number and not by a string like "+".
I don't know whether the problem is in matplotlib, cycler or the combination of both.

Operating system

Artix Linux

Matplotlib Version

3.8.1

Matplotlib Backend

GTK4Agg

Python version

Python 3.11.6

Jupyter version

No response

Installation

Linux package manager

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issueshttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!status: confirmed bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.