ott.tools.plot.PlotMM

Contents

ott.tools.plot.PlotMM#

class ott.tools.plot.PlotMM(fig=None, ax=None, fix_axes_lim=False, cmap='cividis_r', markers='svopxdh', alpha=0.6, title=None)[source]#

Plots an optimal transport map for MMSinkhorn.

It enables to either plot or update a plot in a single object, offering the possibilities to create animations as a FuncAnimation, which can in turned be saved to disk at will. There are two design principles here:

  1. we do not rely on saving to/loading from disk to create animations

  2. we try as much as possible to disentangle the transport problem from

    its visualization.

Parameters:
  • fig (Optional[Figure]) – Specify figure object. Created by default

  • ax (Optional[Axes]) – Specify axes objects. Created by default

  • fix_axes_lim (bool) – Whether to fix x/y limits to \([0, 1]\).

  • cmap (Union[str, Colormap]) – color map used to plot line colors.

  • markers (str) – Markers for each marginal.

  • alpha (float) – default alpha value for lines.

  • title (Optional[str]) – title of the plot.

Methods

animate(transports[, titles, frame_rate, top_k])

Make an animation from several transports.

update(ot[, title, top_k])

Update a plot with a transport instance.