-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Refactor] Use context manager to reuse matplotlib figures. (#432)
* Add `BaseImshowContextmanager` and `ImshowInfosContextManager` to reuse matplotlib figure. * Use context manager to implement `imshow_infos` * Add unit tests. * More general base context manager. * unit tests for context manager. * Improve docstring. * Fix context manager exit cannot close figure when matplotlib>=3.4.0 * Fix unit tests * Support inline backend in visualization.
- Loading branch information
Showing
4 changed files
with
600 additions
and
255 deletions.
There are no files selected for viewing
429 changes: 279 additions & 150 deletions
429
docs_zh-CN/tutorials/MMClassification_python_cn.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
from .image import color_val_matplotlib, imshow_infos | ||
from .image import (BaseFigureContextManager, ImshowInfosContextManager, | ||
color_val_matplotlib, imshow_infos) | ||
|
||
__all__ = ['imshow_infos', 'color_val_matplotlib'] | ||
__all__ = [ | ||
'BaseFigureContextManager', 'ImshowInfosContextManager', 'imshow_infos', | ||
'color_val_matplotlib' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.