make_norm_from_scale(scale_cls, base_norm_cls=None, *, init=None)
After :
@make_norm_from_scale(scale_cls) class norm_cls(Normalize): ...
norm_cls is filled with methods so that normalization computations are forwarded to scale_cls (i.e., scale_cls is the scale that would be used for the colorbar of a mappable normalized with norm_cls).
If init is not passed, then the constructor signature of norm_cls will be norm_cls(vmin=None, vmax=None, clip=False)
; these three parameters will be forwarded to the base class ( Normalize.__init__
), and a scale_cls object will be initialized with no arguments (other than a dummy axis).
If the scale_cls constructor takes additional parameters, then init should be passed to make_norm_from_scale
. It is a callable which is only used for its signature. First, this signature will become the signature of norm_cls. Second, the norm_cls constructor will bind the parameters passed to it using this signature, extract the bound vmin, vmax, and clip values, pass those to Normalize.__init__
, and forward the remaining bound values (including any defaults defined by the signature) to the scale_cls constructor.
Decorator for building a .Normalize
subclass from a ~.scale.ScaleBase
subclass.
The following pages refer to to this document either explicitly or contain code examples using this.
matplotlib.colors.make_norm_from_scale
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them