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

Color maps from function #19258

Copy link
Copy link
Open
Open
Copy link
@Inspirateur

Description

@Inspirateur
Issue body actions

Problem

Would be nice if we could just pass a function as a cmap, and matplotlib would just query it to get a color from a value.

example of usage:

from colorsys import hsl_to_rgb
import matplotlib.pyplot as plt

y = ...  # some data for an histogram
cmap = lambda x: hsl_to_rgb(x, .9, .5)**2
plt.hist(y, cmap=cmap)

Proposed Solution

I don't know how realistic this is but I've just never seen it even suggested when googling.
It certainly feels reasonable to me but I can't tell because I don't know much about the implementation.
If this is not feasible at least this would set a record for future google queries...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No 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.