There's more...
In the preceding plot, we displayed the complete data range available in the input data. However, we can limit the the data range we want to color code using the plt.clim() method. This is useful when there are outliers (a few entries of the variable are too large or too small compared to rest of the data), and then by default the colormap extends color codes for the complete range of data. When there are outliers, because of the larger range, the majority of the values get blurred and outliers stand out with extreme colors. If we want to suppress the impact of outliers, we can limit the data range that excludes the outliers and plot the desired range with a complete list of colors in the colorbar. This gives a true picture ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access