Skip to content

logitlocator misses tick at edge of axis #14743

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
anntzer opened this issue Jul 11, 2019 · 8 comments
Open

logitlocator misses tick at edge of axis #14743

anntzer opened this issue Jul 11, 2019 · 8 comments

Comments

@anntzer
Copy link
Contributor

anntzer commented Jul 11, 2019

Bug report

Bug summary

When no data is plotted, a logit scale ignores calls to set_{x/y}lim and sticks to the default(?) of [1e-7, 1-1e-7]


edit: fixed, but see follow up at #14743 (comment).

Code for reproduction

gca().set(yscale="logit", ylim=(.9, .999))  # or (.001, .1), or etc.

Actual outcome

test

This image is made with the formatter provided by #14512 for legibility (the formatter before that PR is impossible to read), but that doesn't change the axes limits.

Expected outcome

limits respecting the set ylims.
Note that adding a call to e.g. plot(<any values>) (within or without the given limits) fixes the issue.

Matplotlib version

  • Operating system: linux
  • Matplotlib version: 3.1 or master, perhaps earlier?
  • Matplotlib backend (print(matplotlib.get_backend())): any
  • Python version: 3.7
  • Jupyter version (if applicable):
  • Other libraries:
@lukelbd
Copy link
Contributor

lukelbd commented Aug 8, 2019

This issue seems to be more complicated. When I try to explicitly set the axis limits, axis limits revert to the default (i.e. the opposite of what I want). This is independent of whether I run a plot command afterward. Also the default range is too large and default number of ticks is too high.

import matplotlib.pyplot as plt
import numpy as np
f, ax = plt.subplots()
N = 50
ax.set_yscale('logit')
# ax.set_ylim((0.1,0.9))
ax.plot(np.linspace(0,1,N), np.linspace(0.1,0.9,N))

bug2

import matplotlib.pyplot as plt
import numpy as np
f, ax = plt.subplots()
N = 50
ax.set_yscale('logit')
ax.set_ylim((0.1,0.9))
ax.plot(np.linspace(0,1,N), np.linspace(0.1,0.9,N))

bug1

@timhoffm
Copy link
Member

timhoffm commented Aug 10, 2019

As of master, the results are
grafik

grafik

So at least the number of ticks issue is solved (cf. #14512).

@tacaswell tacaswell added this to the v3.2.0 milestone Sep 10, 2019
@anntzer anntzer modified the milestones: v3.2.0, v3.3.0 Sep 10, 2019
@anntzer
Copy link
Contributor Author

anntzer commented Sep 10, 2019

The original issue was fixed in #14928, but there's a small followup: when doing gca().set(yscale="logit", ylim=(.9, .999)), there is no tick at x=0.999, but it shows up if the upper limit is 0.999001 for example. Probably just a matter of < vs <=...

@anntzer anntzer changed the title logit scale ignores limits when no data is plotted logitlocator misses tick at edge of axis Sep 10, 2019
@RiazCharania
Copy link

Is anyone else currently working on this? If not I'll give it a try.

@timhoffm
Copy link
Member

timhoffm commented Mar 4, 2020

Go for it.

@wang305305
Copy link

Is anyone else currently working on this? If not I'll give it a try.

RiazCharania and I will not be working on this issue.

@QuLogic QuLogic modified the milestones: v3.3.0, v3.4.0 May 7, 2020
@QuLogic QuLogic modified the milestones: v3.4.0, v3.5.0 Jan 27, 2021
@QuLogic QuLogic modified the milestones: v3.5.0, v3.6.0 Sep 25, 2021
@oscargus
Copy link
Member

oscargus commented Jun 4, 2022

The remaining example gca().set(yscale="logit", ylim=(.9, .999)) now gives:
image

which seems different from the description, but hardly correct.

@anntzer
Copy link
Contributor Author

anntzer commented Jul 15, 2022

I think that's what I said: a tick is missing at the top (1-1e-3).

@QuLogic QuLogic modified the milestones: v3.6.0, v3.7.0 Aug 24, 2022
@ksunden ksunden modified the milestones: v3.7.0, v3.7.1 Feb 14, 2023
@QuLogic QuLogic modified the milestones: v3.7.1, v3.7.2 Mar 4, 2023
@QuLogic QuLogic modified the milestones: v3.7.2, v3.7.3 Jul 5, 2023
@QuLogic QuLogic modified the milestones: v3.7.3, v3.8.0 Sep 9, 2023
@ksunden ksunden removed this from the v3.8.0 milestone Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants