ott.tools.plot.Plot#
- class ott.tools.plot.Plot(fig=None, ax=None, threshold=-1.0, scale=200, show_lines=True, cmap='cool', scale_alpha_by_coupling=False, alpha=0.7, title=None, xlim=None, ylim=None)[source]#
Plot an optimal transport map between two point clouds.
This object can either plot or update a plot, to create animations as a
FuncAnimation, which can in turned be saved to disk at will. There are two design principles here:we do not rely on saving to/loading from disk to create animations
we try as much as possible to disentangle the transport problem from its visualization.
We use 2D scatter plots by default, relying on PCA visualization for d>3 data. This step requires a conversion to a numpy array, in order to compute leading singular values. This tool is therefore not designed having performance in mind.
- Parameters:
fig (
Optional[Figure]) – Specify figure object. Created by defaultax (
Optional[Axes]) – Specify axes objects. Created by defaultthreshold (
float) – value below which links in transportation matrix won’t be plotted. This value should be negative when using animations.scale (
int) – scale used for marker plots.show_lines (
bool) – whether to show OT lines, as described inot.matrixargumentcmap (
str) – color map used to plot line colors.scale_alpha_by_coupling (
bool) – use or not the coupling’s value as proxy for alphaalpha (
float) – default alpha value for lines.
Methods