Skip to content

scatter drops points if xscale is activated TOO LATE #3059

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

Closed
untom opened this issue May 13, 2014 · 5 comments
Closed

scatter drops points if xscale is activated TOO LATE #3059

untom opened this issue May 13, 2014 · 5 comments

Comments

@untom
Copy link

untom commented May 13, 2014

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.

@tacaswell
Copy link
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.

@tacaswell tacaswell modified the milestones: v1.4.x, v1.4.0 May 17, 2014
@tacaswell tacaswell modified the milestones: v1.4.x, v1.4.0 Jun 4, 2014
@tacaswell
Copy link
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.

@cimarronm
Copy link
Contributor

PR #3481 should resolve this issue

@tacaswell tacaswell modified the milestones: v1.4.x, 1.5.0 Feb 7, 2015
@tacaswell tacaswell modified the milestones: proposed next point release, next point release Jul 16, 2015
@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Oct 3, 2017
@tacaswell tacaswell modified the milestones: needs sorting, v3.4.0, v3.3.0 Aug 11, 2020
@tacaswell
Copy link
Member

On current master and with v3.3.0 this produces

image

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

@QuLogic QuLogic modified the milestones: v3.3.0, v3.2.0 Aug 11, 2020
@QuLogic
Copy link
Member

QuLogic commented Aug 11, 2020

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
Projects
None yet
Development

No branches or pull requests

4 participants