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

Fix axis limits not set correctly upon redrawing #25

Merged
merged 4 commits into from
Jul 26, 2024

Conversation

jo-mueller
Copy link
Contributor

@jo-mueller jo-mueller commented Jul 19, 2024

Fixes #24

Update Scatter and Histogram2D classes to set axis limits based on data.

  • Scatter class:
    • Update data setter method to set x and y axis limits based on the data.
  • Histogram2D class:
    • Update data setter method to set x and y axis limits based on the data.
  • Tests:
    • Add tests to ensure that the axis limits are set correctly for the Scatter class.
    • Add tests to ensure that the axis limits are set correctly for the Histogram2D class.

For more details, open the Copilot Workspace session.

@jo-mueller jo-mueller requested a review from zoccoler July 19, 2024 11:50
Copy link

codecov bot commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.77%. Comparing base (d1ebeb4) to head (6b5e431).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
+ Coverage   90.66%   90.77%   +0.11%     
==========================================
  Files           7        7              
  Lines         621      629       +8     
==========================================
+ Hits          563      571       +8     
  Misses         58       58              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Add a margin of 5% to the xlimits and ylimits of the plot upon redraw

* Modify `Scatter` class in `src/biaplotter/artists.py` to add a margin of 5% to the xlimits and ylimits in the `data` property setter.
* Modify `Histogram2D` class in `src/biaplotter/artists.py` to add a margin of 5% to the xlimits and ylimits in the `data` property setter.
* Update tests in `src/biaplotter/_tests/test_artists.py` to verify that the xlimits and ylimits include a margin of 5% beyond the minimum and maximum values of the data.


---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/BiAPoL/biaplotter/pull/25?shareId=11a0d7b2-c389-46cd-a8fb-9e810aeb76dd).
@zoccoler
Copy link
Contributor

Hi @jo-mueller ,

That makes sense for the scatter plot, but maybe not for the histogram, what do you think? Take a look at the comparisons below:

Scatter before current changes:
image

Scatter after current changes:
image

Histogram before current changes:
image

Histogram after current changes:
image

@jo-mueller
Copy link
Contributor Author

uh....good point. I'll remove it from the histogram

@zoccoler zoccoler merged commit 41f58dd into main Jul 26, 2024
11 checks passed
@jo-mueller jo-mueller deleted the jo-mueller/fix-axis-limits branch August 8, 2024 13:53
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.

Axis limits not set correctly upon redrawing
2 participants