Stone-Soup
Stone-Soup copied to clipboard
SIAP Metrics Table
The SIAP metrics table works fine in the example Metrics python notebook. I am interested in saving the table to a png file. When I try this I am only seeing a part of a single row. An HTML output option might be useful in some cases.
This is a common issue with matplotlib, often cutting off annotations and tables, etc. Addding bbox_inches='tight'
to the savefig
arguments should resolve it.
As this is image generated in matplotlib currently, it wouldn't be possible to create HTML. You could do something like embed as data URI like suggested in this answer on StackOverflow.
Thank you for the response.
bbox_inches='tight' produces the following output from plt.savefig('test3.png',bbox_inches='tight'). This is better but not complete.
Interesting.
Does this work?
table = SIAPTableGenerator(...).compute_metric()
table.figure.savefig('test.png', bbox_inches='tight')
No. I tried this also
(Pdb) plt.tight_layout()
Test st.figure.savefig('test4.png',bbox_inches='tight')
I've just opened a PR that will hopefully scale the figure size better.
I'm not sure why the text is missing in your plot?
I pulled the latest SS from the repo.. Next I made the PR changes to metrictables.py, still same behavior on my end. Note it is fine (correct plot) in Jupyter Notebook. Saving to a png file is the challenge.
What version of matplotlib are you using?