tfplot.contrib

Some predefined plot functions.

tfplot.contrib.probmap(*args, **kwargs_call)[source]

Display a heatmap in color. The resulting op will be a RGBA image Tensor.

Parameters:
  • x – A 2-D image-like tensor to draw.
  • cmap – Matplotlib colormap. Defaults ‘jet’
  • axis – If True (default), x-axis and y-axis will appear.
  • colorbar – If True (default), a colorbar will be placed on the right.
  • vmin – A scalar. Minimum value of the range. See matplotlib.axes.Axes.imshow.
  • vmax – A scalar. Maximum value of the range. See matplotlib.axes.Axes.imshow.
Returns:

A uint8 Tensor of shape (?, ?, 4) containing the resulting plot.

tfplot.contrib.probmap_simple(x, **kwargs)[source]

Display a heatmap in color, but only displays the image content. The resulting op will be a RGBA image Tensor.

It reduces to probmap having colorbar and axis off. See the documentation of probmap for available arguments.

tfplot.contrib.batch(func)[source]

Make an autowrapped plot function (… -> RGBA tf.Tensor) work in a batch manner.

Example

>>> p
Tensor("p:0", shape=(batch_size, 16, 16, 4), dtype=uint8)
>>> tfplot.contrib.batch(tfplot.contrib.probmap)(p)
Tensor("probmap/PlotImages:0", shape=(batch_size, ?, ?, 4), dtype=uint8)