-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Logit scale doesn't position x/ylabel correctly first draw #11386
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
Comments
I don’t have a computer to see what the issue could be. Off the top of my head I can’t see why either layout manager would care what the scale is so there must be something funky going on here... |
I tried to look at it and my guess is that the problem is that the following spine consist of infs in the first call in
subplotpars consist of |
@fredrik-1 Thanks :)! It may indeed be consistent with my quick look at the issue, which suggests that something is going wrong with the positions of some ticks (=> the attached text label(s) possibly receiving a non finite position, which could lead an “infinite” FYI, spines are the “borders” of the axes. See for example this plot (bottom right) |
|
So, just to clarify this bug: The error is in spinebbox = spine.get_transform().transform_path(
spine.get_path()).get_extents() The reason is that for the first call to
and a logit scale doesn't deal well with the values of 13, which are greater than 1. ( Interesting other scales return the same path; Of course the ylabel position shouldn't need to know anything about the y-extent of the path, so the bad value in the path doesn't normally affect the transform. But because it goes to inf, it screws up the matrix algebra of the transform and makes a mess for the Logit scale. Note that on master, the logit scale does not display the ylabel on the first draw. Subsequent draws, the Path is correct, and the ylabel appears. The fudnamental issue is |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug summary
Using
constrained_layout
ortight_layout
in conjunction with alogit
scale fails or crashes.Constrained layout:
results in a crash of python in Windows. I.e. it shows a pop up saying python needs to be closed because it crashed.
Tight layout
produces a long traceback for a
ValueError: cannot convert float NaN to integer
.Expected outcome
Using either of above without layout manager gives the correct figure.
Also, using either of above without the line
ax.set_xscale('logit')
produces the expected output.This may be related to #5456.
Matplotlib version
print(matplotlib.get_backend())
): Qt5Agg, TkAggThe text was updated successfully, but these errors were encountered: