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

2 tick minimum also for logscale #372

Merged
merged 11 commits into from
Apr 8, 2024
Merged

2 tick minimum also for logscale #372

merged 11 commits into from
Apr 8, 2024

Conversation

lukashergt
Copy link
Collaborator

@lukashergt lukashergt commented Mar 16, 2024

Description

As raised in #362, logscales can lead to plots with only a single tick mark. This PR aims at fixing that, such that every plot has a minimum of 2 tick marks.

Fixes #362

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 Mar 16, 2024
@lukashergt lukashergt self-assigned this Mar 16, 2024
@lukashergt
Copy link
Collaborator Author

Failing tests after 0262e96 (implenting b59da43) highlight the problem.

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (80769c5) to head (3bef1ec).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #372   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           36        36           
  Lines         3032      3041    +9     
=========================================
+ Hits          3032      3041    +9     

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

@lukashergt lukashergt marked this pull request as ready for review March 19, 2024 22:34
@@ -355,6 +355,8 @@ def plot_2d(self, axes=None, *args, **kwargs):
else:
ax.plot([], [])

axes._set_logticks()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried setting the log ticks in the same place where we generally deal with tick locations, but plot_2d overwrites these locations, so this call at the end of plot_2d is needed...

…to recent changes but for some reason acts up"

This reverts commit eba68c8.
…not robust across different figure sizes, where often the yaxis is shorter than the xaxis, which caused failures in some CI settings
…sses with other tests, make the test work with default settings instead
…test is not robust across different figure sizes, where often the yaxis is shorter than the xaxis, which caused failures in some CI settings"

This reverts commit 3bcc92d.
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.

Many thanks @lukashergt!

@lukashergt lukashergt merged commit ef8a27e into master Apr 8, 2024
22 checks passed
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.

Single ticks in log plots
2 participants