-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
rasterized
arg for heatmaps (#359)
## Description <!-- Provide a brief description of the PR's purpose here. --> A useful feature in heatmap visualizations is to rasterize the heatmap itself but not the surrounding text of the plot. This is useful when saving to PDF for instance, as we want to rasterize the heatmap so that the PDF does not have to render hundreds or thousands of cells. Instead, it can just render a single image for the heatmap, while the surrounding text is maintained in vector format. Previously, we had to rasterize the entire plot, so even the text was converted to pixels when it can easily be represented in vector format. The API change is to add a `rasterized` argument to `grid_archive_heatmap`, `cvt_archive_heatmap`, and `sliding_boundareis_archive_heatmap`. This is similar to how Matplotlib methods like [pcolormesh](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.pcolormesh.html) handle rasterization. ## TODO <!-- Notable points that this PR has either accomplished or will accomplish. --> - [x] Add rasterized arg in grid_archive_heatmap — rasterized is passed into pcolormesh, and pcm_kwargs is not allowed to contain rasterized since that would result in a duplicate kwarg to pcolormesh - [x] Add rasterized arg in cvt_archive_heatmap — rasterized is passed into PolyCollection - [x] Add rasterized arg in sliding_boundaries_archive_heatmap ## Questions <!-- Any concerns or points of confusion? --> ## Status - [x] I have read the guidelines in [CONTRIBUTING.md](https://github.com/icaros-usc/pyribs/blob/master/CONTRIBUTING.md) - [x] I have formatted my code using `yapf` - [x] I have tested my code by running `pytest` - [x] I have linted my code with `pylint` - [x] I have added a one-line description of my change to the changelog in `HISTORY.md` - [x] This PR is ready to go
- Loading branch information
Showing
9 changed files
with
70 additions
and
8 deletions.
There are no files selected for viewing
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
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
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
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
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
Binary file added
BIN
+101 KB
tests/visualize/baseline_images/visualize_test/cvt_archive_heatmap_rasterized.pdf
Binary file not shown.
Binary file added
BIN
+8.97 KB
tests/visualize/baseline_images/visualize_test/grid_archive_heatmap_rasterized.pdf
Binary file not shown.
Binary file added
BIN
+54.2 KB
tests/visualize/baseline_images/visualize_test/sliding_boundaries_heatmap_rasterized.pdf
Binary file not shown.
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