Skip to content

scatter drops points if xscale is activated TOO LATE #3059

Closed

Description

@untom

I'm using matplotlib 1.3.1 with GTKagg backend. I found that if I call ax.set_xscale before calling ax.scatter everything works fine. However if I change the order of the commands, most points are not displayed. Here is some sample code:

fig, ax = plt.subplots(1, 2)
n = 1000
x = np.abs(np.random.laplace(size=n))
y = np.arange(n)
ax[0].scatter(x, y)
ax[0].set_xscale('log')
ax[1].set_xscale('log')
ax[1].scatter(x, y)

This leads to the following output: http://imgur.com/xqsR9fr

I'm not sure if this is the same as #2872 or not, maybe someone who has the current master installed can test that.

Activity

  1. tacaswell commented on May 13, 2014

    @tacaswell
    Member

    This is an issue of auto-scale not working as well as it should. Calling

    ax[0].set_xlim(.0001, 10)
    plt.draw()
    

    makes the two axes identical.

  2. modified the milestones: v1.4.x, v1.4.0 on May 17, 2014
  3. modified the milestones: v1.4.x, v1.4.0 on Jun 4, 2014
  4. tacaswell commented on Jun 4, 2014

    @tacaswell
    Member

    Punting to 1.4.x.

    I am no longer sure this is a bug as I am not sure if scatter should call auto-scale or not.

  5. cimarronm commented on Sep 6, 2014

    @cimarronm
    Contributor

    PR #3481 should resolve this issue

  6. modified the milestones: v1.4.x, on Feb 7, 2015
  7. modified the milestones: , on Jul 16, 2015
  8. modified the milestones: , on Oct 3, 2017
  9. tacaswell commented on Aug 11, 2020

    @tacaswell
    Member

    On current master and with v3.3.0 this produces

    image

    Close (and not chasing back to when we actually fixed this...)

  10. modified the milestones: v3.3.0, v3.2.0 on Aug 11, 2020
  11. QuLogic commented on Aug 11, 2020

    @QuLogic
    Member

    It's fixed in 3.2.2 at least, so I'd wager it's the lazy autoscaling work in 3.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions