hyperdimensional-computing / torchhd

Torchhd is a Python library for Hyperdimensional Computing and Vector Symbolic Architectures
https://torchhd.readthedocs.io
MIT License
233 stars 24 forks source link

Plotting #67

Closed dheyay closed 2 years ago

dheyay commented 2 years ago
mikeheddes commented 2 years ago

Thanks for the PR. Can you move the plotting to a new module called utils? And rename visualize to plot? Can you perform the import of matplotlib inside the function and throw an informative error telling the user to install matplotlib if they wanna use this function. This will make matplotlib an optional dependency. For the API of the functions can you look at how Seaborn does it? I think they allow you to provide your own axis of the plot. And you don’t have to call show in the function. The function should return the axis like Seaborn. Thank you!

dheyay commented 2 years ago

I have changed the functions to take in the "matplotlib axes" as an optional argument and the kwargs accomodates all the other optional arguments that are passed to the underlying pyplot functions.