Matplotlib.colors.SymLogNorm class in Python
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.
Note: For more information, refer to Python Matplotlib – An Overview
The matplotlib.colors.SysLogNorm 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.SymLogNorm class is used for symmetric logarithmic scaling to both positive and negative direction from the origin. As value close to the range of zero tend towards infinity, there rose a need to have a linear range around zero. The range under which the plot is linear is called linthresh. The linear range (-linthresh to +linthresh) is stretched relative to the logarithmic range by the help of linscale. The number of decades to use for each half of the linear range is its value. For instance if linscale==1.0(this is also the default), the space covered for the positive and negative halves of the linear range is equivalent to one decade in the range that is logarithmic in nature.
Methods of the class:
- autoscale(self, A): It is used to set the Vmax and Vmin of A.
- autoscale_None(self, A): It is used to autoscale the vmax vmin that has None as its value.
- inverse(self, value): it returns the logarithmic inverse of the value.