Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack.
The matplotlib.colors.Normalize class belongs to the matplotlib.colors module. The matplotlib.colors module is used for converting color or numbers arguments to RGBA or RGB.This module is used for mapping numbers to colors or color specification conversion in a 1-D array of colors also known as colormap.
The matplotlib.colors.Normalize class is used to normalize data into the interval of [0.0, 1.0].
class matplotlib.colors.Normalize(vmin=None, vmax=None, clip=False)
If either of vmin or vmax is not set then it initializes from the minimum and maximum value of the first input processed respectively. In other words, __call__(Data) calls autoscale_None(Data). If the value of clip is set to True and the given value is out of range then it returns 0 or 1, whichever is the closest. If vmax==vmin then it returns 0. It operates with both scalar or arrays including masked arrays. The masked values are set to 1 if clip is True, else they remain masked.
- autoscale(self, A): This method sets the vmin to min and vmax to max of A.
- autoscale_None(self, A): This method autoscales only vmin and vmax with None value.
- inverse(self, value): It interchanges the values of vmin and vmax.
- static process_value(value): The value parameter in this method can be a scalar or a sequence. It is used to homogenize input values for efficient and simple normalization. This method returns a masked array of matching values. All float data types are preserved and integer data types with two or smaller bytes are transformed to np.float32, while the larger bytes type are transformed into np.float64. This is done to improve speed for larger arrays by preserving float32 values whenever possible through using in-place operations.
- scaled(self): It returns a boolean to check if vmin or vmax is set.
- Class or Static Variables in Python
- String Template Class in Python
- Changing Class Members in Python
- Object Oriented Programming in Python | Set 1 (Class, Object and Members)
- class method vs static method in Python
- First Class functions in Python
- Violinplot in Python using axes class of Matplotlib
- Class and Instance Attributes in Python
- Matplotlib.ticker.MultipleLocator Class in Python
- Matplotlib.gridspec.GridSpec Class in Python
- CBSE Class 12 | Computer Science - Python Syllabus
- CBSE Class 11 | Computer Science - Python Syllabus
- Matplotlib.patches.CirclePolygon class in Python
- Class as decorator in python
- Python | Avoiding class data shared among the instances
- Python | Using variable outside and inside the class and method
- self in Python class
- Python Tkinter | Create different type of lines using Canvas class
- Python Tkinter | Create different shapes using Canvas class
- How to create a list of object in Python class
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.