giotto-ai / giotto-tda

A high-performance topological machine learning toolbox in Python
https://giotto-ai.github.io/gtda-docs
Other
858 stars 175 forks source link

[BUG] `plot_diagram` assumes no data with negative x- or y- coordinates #409

Closed ulupo closed 4 years ago

ulupo commented 4 years ago

Describe the bug plot_diagram is currently hard-coded to only display the positive x- and y-axes, due I believe to the way range is set for the xaxis1 and yaxis1 keys in the figure's layout dictionary, see https://github.com/giotto-ai/giotto-tda/blob/c5bae0438d056ed9977ccc3e9edf34dbe513a6ca/gtda/plotting/persistence_diagrams.py#L31

As e.g. CubicalPersistence will often lead to negative birth/death values, this assumption leads to incorrect visualisations.

Thanks @lewtun for reporting this!