# serpentTools.plot.cartMeshPlot¶

serpentTools.plot.cartMeshPlot(data, xticks=None, yticks=None, ax=None, cmap=None, logColor=False, normalizer=None, cbarLabel=None, thresh=None, **kwargs)

Create a cartesian mesh plot of the data

Parameters
Returns

Ax on which the data was plotted.

Return type

matplotlib.axes.Axes

Raises
• ValueError – If logColor and data contains negative quantities

• TypeError – If only one of xticks or yticks is None.

Examples

>>> from serpentTools.plot import cartMeshPlot
>>> from numpy import arange
>>> data = arange(100).reshape(10, 10)
>>> x = y = arange(11)
>>> cartMeshPlot(data, x, y, cbarLabel='Demo')

>>> from serpentTools.plot import cartMeshPlot
>>> from numpy import  eye
>>> data = eye(10)
>>> for indx in range(10):
...     data[indx] *= indx
>>> cartMeshPlot(data, logColor=True)


All values less than or equal to zero are excluded from the color normalization. The logColor argument works well for plotting sparse matrices, as the zero-valued indices can be identified without obscuring the trends presented in the non-zero data.

Alternatively, one can use the thresh argument to set a threshold for plotted data. Any value less than or equal to thresh will not be colored, and the colorbar will be updated to reflect this.

>>> from serpentTools.plot import cartMeshPlot
>>> from numpy import arange
>>> data = arange(100).reshape(10, 10)
>>> cartMeshPlot(data, thresh=50)