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 issue where sectors showed a straight line instead of a curved #266
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -642,6 +642,8 @@ def bar(self, direction, var, **kwargs): | |
zorder=zorder, | ||
**kwargs, | ||
) | ||
# needed so the the line of the rectangle becomes curved | ||
patch.get_path()._interpolation_steps = 100 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ultimately, if I understand this correctly, this is a hack b/ it is using a private method to please our eyes with something that did not looked curved due to low resolution but was "correct." With that said, I do prefer this behavior even if it is prone to break with future changes in mpl. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I 100% agree on that being not optimal and originally private, but since it's even in the docs I think that's the only way to get there? I still do think a straight line is technically incorrect in a polar projection. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For our eyes? Yes. I agree. But in theory the "data" is correct otherwise the higher interpolation steps would still produce a straight line, right? Anyway, I did not mean that this was the problem as for a graph what we see is the important part. I think that mpl is probably choosing non-ideals defaults for us in this case. |
||
self.add_patch(patch) | ||
if j == 0: | ||
self.patches_list.append(patch) | ||
|
@@ -718,6 +720,8 @@ def box(self, direction, var, **kwargs): | |
zorder=zorder, | ||
**kwargs, | ||
) | ||
# needed so the the line of the rectangle becomes curved | ||
patch.get_path()._interpolation_steps = 100 | ||
self.add_patch(patch) | ||
if j == 0: | ||
self.patches_list.append(patch) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!