Matrix
Most 2D numpy arrays can be visualized in Scripton using the multi-purpose show
function. For color-mapped matrices, it takes the following concrete form:
def show(
# The matrix to visualize.
matrix: numpy.ndarray,
# An optional title displayed above the visualization.
title: str | None = None,
# The [case-insensitive] name of a colormap (eg: 'turbo')
# See the IDE for a list of available colormaps.
colormap: str | None = None
):
...
Here's an example visualizing a (837, 837)
matrix:
from scripton import show
import numpy as np
dist_matrix = np.load('AlphaFold-Q5VSL9-F1-model_v4_distance_map.npy')
show(dist_matrix, title='Striatin-interacting protein 1')
You can hover over the visualization to view the raw data values (as shown in the screenshot above).
You can easily switch the colormap on-the-fly using the toolbar button.
The extremes of the source data (min/max) map to the extremes of the colormap. Consequently, any two colormapped visualizations are not directly comparable unless they're pre-normalized to the same range.
Smoothing is disabled by default for matrices — zooming in uses nearest neighbor interpolation.