Skip to content

Stop overriding user-input colormap lookup table size #346

@syrte

Description

@syrte

Description

It seems proplot does not work with the conventional discrete color in matplotlib (which I used heavily...).

I noticed the document mentioned discrete several places, but it seems not what I'm looking for.
I can specify discrete=True with scatter, but it gives 10 levels instead of 5 levels as I specified in the code.

Any hint for me? Many thanks!

Steps to reproduce

import numpy as np
from matplotlib import pyplot as plt
import proplot as pplt

fig, ax = pplt.subplot(journal='nat1', refaspect=1)
x, y, c = np.random.rand(3, 100)
cl = ax.scatter(x, y, c=c, cmap=plt.get_cmap('viridis', 5))
ax.colorbar(cl)

Expected behavior: [What you expected to happen]
image

Actual behavior: [What actually happened]
image

Equivalent steps in matplotlib

Please try to make sure this bug is related to a proplot-specific feature. If you're not sure, try to replicate it with the native matplotlib API. Matplotlib bugs belong on the matplotlib github page.

import numpy as np
from matplotlib import pyplot as plt
import proplot as pplt

ax = plt.subplot()
x, y, c = np.random.rand(3, 100)
cl = ax.scatter(x, y, c=c, cmap=plt.get_cmap('viridis', 5))
plt.colorbar(cl)

Proplot version

Paste the results of import matplotlib; print(matplotlib.__version__); import proplot; print(proplot.version)here.

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