Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rasterized arg for heatmaps #359

Merged
merged 8 commits into from
Sep 8, 2023
Merged

Add rasterized arg for heatmaps #359

merged 8 commits into from
Sep 8, 2023

Conversation

btjanaka
Copy link
Member

@btjanaka btjanaka commented Sep 7, 2023

Description

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 handle rasterization.

TODO

  • 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
  • Add rasterized arg in cvt_archive_heatmap — rasterized is passed into PolyCollection
  • Add rasterized arg in sliding_boundaries_archive_heatmap

Questions

Status

  • I have read the guidelines in
    CONTRIBUTING.md
  • I have formatted my code using yapf
  • I have tested my code by running pytest
  • I have linted my code with pylint
  • I have added a one-line description of my change to the changelog in
    HISTORY.md
  • This PR is ready to go

@btjanaka btjanaka changed the title Add rasterize arg for grid and cvt heatmap Add rasterized arg for grid and cvt heatmap Sep 7, 2023
@btjanaka btjanaka changed the title Add rasterized arg for grid and cvt heatmap Add rasterized arg for heatmaps Sep 7, 2023
@btjanaka btjanaka merged commit ae7d004 into master Sep 8, 2023
18 checks passed
@btjanaka btjanaka deleted the rasterize branch September 8, 2023 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant