Skip to content

QuEra colorschemeΒ #295

@jon-wurtz

Description

@jon-wurtz

Provide some default "quera colors" to use in plots and things. For example:

from bloqade import Colorscheme
# Set a specific color
fig,ax = plt.subplots()
plt.plot(x=x,y=y,color=Colorscheme.PURPLE)
# Use the colormap
fig,ax = plt.subplots()
plt.imshow(data, cmap=Colorscheme.cmap)

# Default cycling
fig,ax = plt.subplots()
ax.set_prop_cycle(Colorscheme.COLORS())
plt.plot(x=x1,y=y1)
plt.plot(x=x2,y=y2)
plt.plot(x=x3,y=y3)

Where colorscheme could be an object

from cycler import cycler # builtin
class Colorscheme():
    PURPLE = "#67OEFF"
    ORANGE = "#FF5900"
    RED = "#EF2F55"
    GREEN = "#57BC13"
    # etc.

    @classmethod # or @property
    def COLORS(cls):
        return cycler([cls.PURPLE,cls.ORANGE,cls.RED,cls.GREEN])

    @property
    def cmap():
        return plt.get_cmap("plasma")

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomerspriority: lowlow priority tasks, backlogs, good-to-haves

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions