Skip to content

[FR] indexed image with :auto color #3448

@goretkin

Description

@goretkin

Something like

julia> p = plot(); scatter!(p, rand(10), rand(10), color=:auto); scatter!(p, rand(10), rand(10), color=:auto)

works to produce two scatter plots with automatically chosen colors:
image

I would like the same thing for binary images.

This is possible:

heatmap(rand(0:1, 5, 10), c=cgrad([:black, :red], categorical=true), colorbar=false)

image

but this is not:

heatmap(rand(0:1, 5, 10), c=cgrad([:black, :auto], categorical=true), colorbar=false)

Without something like this, I do not know how to make a recipe for e.g. a "grid" type, that correctly handles colors. See https://discourse.julialang.org/t/handling-color-in-plots-user-recipe-that-produces-an-image-or-indexed-color/59769

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementimproving existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions