Skip to content

Proplot ignores non-none vmin and vmax values on normalizer instances #400

Open
@Jhsmit

Description

@Jhsmit

Description

I'm trying to clip colors in a scatter plot using norm, but the keyword argument seems to be ignored, unless I pass a DiscreteNorm

Steps to reproduce

import proplot as pplt
import matplotlib.pyplot as plt
from matplotlib.colors import Normalize
import numpy as np

print(pplt.__version__)
import matplotlib
print(matplotlib.__version__)

x = np.arange(10)
y = np.random.rand(10)
c = x**2


fig, ax = pplt.subplots()
ax.scatter(x, y, c=c, cmap='viridis', norm=pplt.Norm('linear', 0., 1.))
ax.format(title='proplot')
pplt.show()

fig, ax = pplt.subplots()
ax.scatter(x, y, c=c, cmap='viridis', norm=pplt.DiscreteNorm(np.linspace(0, 1, 6)))
ax.format(title='proplot discrete')
pplt.show()

fig, ax = plt.subplots()
ax.scatter(x, y, c=c, cmap='viridis', norm=Normalize(0, 1))
ax.set_title("matplotlib")
pplt.show()

Proplot:
image

Proplot with discrete norm:
image

Matplotlib:
image

Proplot version

matplotlib: 3.4.3
proplot: 0.9.5

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