Skip to content

Support dpi with Altair#1815

Merged
nfahlgren merged 3 commits intomainfrom
set-altair-ppi
Oct 13, 2025
Merged

Support dpi with Altair#1815
nfahlgren merged 3 commits intomainfrom
set-altair-ppi

Conversation

@nfahlgren
Copy link
Member

@nfahlgren nfahlgren commented Oct 10, 2025

Describe your changes
When you save a PNG image with Altair you can set the output PPI resolution, this PR applies the PlantCV params.dpi setting to the ppl input.

Type of update
Is this a: New feature or feature enhancement

For the reviewer
See this page for instructions on how to review the pull request.

  • PR functionality reviewed in a Jupyter Notebook
  • All tests pass
  • Test coverage remains 100%
  • Documentation tested
  • New documentation pages added to plantcv/mkdocs.yml
  • Changes to function input/output signatures added to updating.md
  • Code reviewed
  • PR approved

@nfahlgren nfahlgren added this to the PlantCV v4.10 milestone Oct 10, 2025
@nfahlgren nfahlgren added the enhancement Enhancements to existing features label Oct 10, 2025
@github-project-automation github-project-automation bot moved this to Pull Requests in PlantCV4 Oct 10, 2025
@deepsource-io
Copy link

deepsource-io bot commented Oct 10, 2025

Here's the code health analysis summary for commits b650e66..962d675. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython✅ SuccessView Check ↗
DeepSource Test coverage LogoTest coverage✅ SuccessView Check ↗

Code Coverage Report

MetricAggregatePython
Branch Coverage100%100%
Composite Coverage100%100%
Line Coverage100%100%
New Branch Coverage100%100%
New Composite Coverage100%100%
New Line Coverage100%, ✅ Above Threshold100%, ✅ Above Threshold

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@HaleySchuhl HaleySchuhl self-requested a review October 10, 2025 20:49
still return interactive plot in hyper_hist, but remove from the chart getting passed to _debug because interactive plots will not respect dpi/ppi
Copy link
Contributor

@HaleySchuhl HaleySchuhl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works nicely. I was not seeing a difference in the saved output from pcv.visualize.hyper_histogram, but it's definitely having an impact on the chart saved out while running pcv.analyze.spectral_reflectance and pcv.analyze.grayscale.

pcv.visualize.hyper_histogram appears to ignore the ppi setting because it's interactive. If I remove .interactive() then dpi/ppi is respected. so I changed the code slightly so it still returns an interactive plot, but _debug is passed a static version so it'll respect the dpi.

color_correction.py, histogram.py, and obj_size_ecdf.py
@nfahlgren nfahlgren merged commit 2766a24 into main Oct 13, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Pull Requests to Done in PlantCV4 Oct 13, 2025
@nfahlgren nfahlgren deleted the set-altair-ppi branch October 13, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancements to existing features ready to review

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants