Skip to content

Uptade fix number of levels with log contour #29137

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ebarcelosf
Copy link

@ebarcelosf ebarcelosf commented Nov 13, 2024

PR summary

By passing an integer value in the levels argument to specify the maximum number of contour levels, the program didn't always respect this limit in practice.
Adjusts the behavior so that the number of contour levels is generated as requested, even when using a logarithmic scale.
Fix #27576

PR checklist

@@ -960,13 +960,12 @@ def changed(self):
label.set_color(self.labelMappable.to_rgba(cv))
super().changed()

def _autolev(self, N):
def _autolev(self, N, *, using_default):
Copy link
Member

Choose a reason for hiding this comment

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

I think this extra argument is not necessary.

The only place where this is passed it is simply a N is not None (on the input side, but the effect is the same)

So even if the variable is useful, it can be computed internally.

However, even further, the difference between LogLocator() and LogLocator(numticks=N) when N is None is nothing, therefore you can just pass it as a kwarg.

Haven't fully thought through the last portion (adjustments if levels are still insufficient) and if there may need to be at least a if N is not None in there potentially, but not sure yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for author
Development

Successfully merging this pull request may close these issues.

2 participants