Skip to content

cycle in .ultraplotrc is stored in rc but not applied to axes.prop_cycle #857

Closed

Description

@beskep

ultraplot v2.7.3
python v3.15

.ultraplotrc

cycle: qual1

main.py

import numpy as np
import ultraplot as uplt
from matplotlib.colors import to_hex

print(uplt.rc_ultraplot["cycle"])  # 'qual1'
print(uplt.rc.cycle)  # 'qual1'

array = np.random.rand(5, 4)

fig, ax = uplt.subplots()
lines = ax.plot(array)
print([to_hex(l.get_color()) for l in lines])
# default colors ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728']

uplt.rc.reset()
fig, ax = uplt.subplots()
lines = ax.plot(array)
print([to_hex(l.get_color()) for l in lines])
# qual1 colors ['#5bbe94', '#91be64', '#e5cf6c', '#e87b70']

uplt.rc.cycle = "qual1"  # runtime assignment applies correctly
fig, ax = uplt.subplots()
lines = ax.plot(array)

print([l.get_color() for l in lines])
# qual1 colors ['#5bbe94ff', '#91be64ff', '#e5cf6cff', '#e87b70ff']

rc.register_handler("cycle", _cycle_handler) is in colors.py,
but it appears to be registered only after rc has been created and the rc files loaded.

Activity

  1. added
    bug
    on Nov 5, 2026
  2. cvanelteren commented on Nov 5, 2026

    @cvanelteren
    Collaborator

    I think this is spot on. Will fix.

  3. cvanelteren commented on Nov 5, 2026

    @cvanelteren
    Collaborator

    Fixed on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions