Skip to content

ax.scatter Ignores "cmap" Argument When 'c' Argument is a List of Values Between 0 and 1 #615

@chudlerk

Description

@chudlerk

Hello,

When I run the following simple script:

import ultraplot as uplt
fig,ax=uplt.subplots()
ax.scatter(
    [1.0, 2.0, 3.0, 4.0],
    [1.0, 2.0, 3.0, 4.0],
    c=[.1, .2, .3, .4], 
    cmap='turbo',
    )

I get the following warning:
UltraPlotWarning: Ignoring unused keyword arg(s): {'cmap': 'turbo'}
and the resulting scatter plot does not use the specified colormap.

If I do the same thing with matplotlib, it works fine:

import matplotlib.pyplot as plt
fig,ax=plt.subplots()
ax.scatter(
    [1.0, 2.0, 3.0, 4.0],
    [1.0, 2.0, 3.0, 4.0],
    c=[0.1, 0.2, 0.3, 0.4],
    cmap='turbo',
    )

I am using the latest version of ultraplot (2.1.3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions