Bug causes to_rgba to fail inside cm.py · Issue #10890 · matplotlib/matplotlib · GitHub
Skip to content

Bug causes to_rgba to fail inside cm.py #10890

Description

@Eagleames

I was running a test with some new images and plotting, code called cm.to_rgba() to convert the files for keras processing.

Matplotlib 2.1.2 (but verified in the current repository)

It 'works' however it throws an error, by mistake due to this error in code:

                if xx.dtype.kind == 'f':
                    if norm and xx.max() > 1 or xx.min() < 0:
                        raise ValueError("Floating point image RGB values "
                                         "must be in the 0..1 range.")

If xx.min() <0 then this code piece triggers.

Should be:

                if xx.dtype.kind == 'f':
                    if norm and (xx.max() > 1 or xx.min() < 0):
                        raise ValueError("Floating point image RGB values "
                                         "must be in the 0..1 range.")

Sorry.. not familiar enough with making pull requests and changes myself to do this!

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions