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 logscale limit updates #383

Merged
merged 4 commits into from
Apr 24, 2024
Merged

Fix logscale limit updates #383

merged 4 commits into from
Apr 24, 2024

Conversation

lukashergt
Copy link
Collaborator

@lukashergt lukashergt commented Apr 23, 2024

This PR addresses #381, where subsequent plots on logarithmic axes did not correctly update the plotting limits.

Fixes #381

Checklist:

  • I have performed a self-review of my own code
  • My code is PEP8 compliant (flake8 anesthetic tests)
  • My code contains compliant docstrings (pydocstyle --convention=numpy anesthetic)
  • New and existing unit tests pass locally with my changes (python -m pytest)
  • I have added tests that prove my fix is effective or that my feature works
  • I have appropriately incremented the semantic version number in both README.rst and anesthetic/_version.py

@lukashergt lukashergt added the bug Something isn't working label Apr 23, 2024
@lukashergt lukashergt self-assigned this Apr 23, 2024
Copy link

codecov bot commented Apr 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (79c7bb6) to head (c026fb7).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #383   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           36        36           
  Lines         3052      3056    +4     
=========================================
+ Hits          3052      3056    +4     

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

Copy link
Collaborator

@williamjameshandley williamjameshandley left a comment

Choose a reason for hiding this comment

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

Nice work @lukashergt. I can confirm that fixes my (less minimal) use case. Many thanks!

@@ -356,7 +356,7 @@ def plot_2d(self, axes=None, *args, **kwargs):
if np.isinf(self[x]).any():
warnings.warn(f"column {y} has inf values.")
selfxy = self[[x, y]]
selfxy = self.replace([-np.inf, np.inf], np.nan)
selfxy = selfxy.replace([-np.inf, np.inf], np.nan)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this related to this PR, or a correction to #324 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not related to this PR, it's a correction of #324 that I snuck in.

@lukashergt lukashergt merged commit 32769e8 into master Apr 24, 2024
22 checks passed
AdamOrmondroyd pushed a commit to AdamOrmondroyd/anesthetic that referenced this pull request May 28, 2024
* test that limits get accurately updated by successive plots with logscale axes, adjusting to new data limits, see issue handley-lab#381

* fix typo from PR handley-lab#324

* bump version to 2.8.10

* update logscale plot limits to datalimits at the end, making use of `ax.dataLim`
AdamOrmondroyd added a commit that referenced this pull request Jun 24, 2024
* allow matplotlib 3.9

* bump version to 2.8.10

* Fix logscale limit updates (#383)

* test that limits get accurately updated by successive plots with logscale axes, adjusting to new data limits, see issue #381

* fix typo from PR #324

* bump version to 2.8.10

* update logscale plot limits to datalimits at the end, making use of `ax.dataLim`

* Fix macOS CI (#385)

* attempt at fixing macOS CI by brew installing hdf5

* update from `miniconda@v2` to `miniconda@v3`

* bump version to 2.8.11

* try newer `tables` version, which was previously restricted to 3.8.0 in #379

* Revert "attempt at fixing macOS CI by brew installing hdf5"

This reverts commit 968bdb3.

* Reapply "attempt at fixing macOS CI by brew installing hdf5"

This reverts commit 204014a.

Seems like this is needed after all, otherwise macOS is struggling to
find a local HDF5.

---------

Co-authored-by: Will Handley <[email protected]>

* Fix to `color='C2'` plot_2d error post pandas 2 (#382)

* Added failing test

* bump version to 2.8.10

* Get color from self.color

* Update README.rst

* Update _version.py

* Update README.rst

* Update _version.py

---------

Co-authored-by: Lukas Hergt <[email protected]>

* bump version to 2.8.10

* bump version to 2.8.11

* bump version to 2.8.13

---------

Co-authored-by: Lukas Hergt <[email protected]>
Co-authored-by: Will Handley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

logscale plot axes limit issues
2 participants