matplotlib.colors.make_norm_from_scale#
- matplotlib.colors.make_norm_from_scale(scale_cls,base_norm_cls=None,*,init=None)[source]#
Decorator for building a
Normalizesubclass from aScaleBasesubclass.After
@make_norm_from_scale(scale_cls)classnorm_cls(Normalize):...
norm_cls is filled with methods so that normalization computations areforwarded toscale_cls (i.e.,scale_cls is the scale that would be usedfor the colorbar of a mappable normalized withnorm_cls).
Ifinit is not passed, then the constructor signature ofnorm_clswill be
norm_cls(vmin=None,vmax=None,clip=False); these threeparameters will be forwarded to the base class (Normalize.__init__),and ascale_cls object will be initialized with no arguments (other thana dummy axis).If thescale_cls constructor takes additional parameters, theninitshould be passed to
make_norm_from_scale. It is a callable which isonly used for its signature. First, this signature will become thesignature ofnorm_cls. Second, thenorm_cls constructor will bind theparameters passed to it using this signature, extract the boundvmin,vmax, andclip values, pass those toNormalize.__init__, andforward the remaining bound values (including any defaults defined by thesignature) to thescale_cls constructor.